From 2844313e4de8a3a4971e8cc508380b30058aa266 Mon Sep 17 00:00:00 2001 From: gifrerenom Date: Tue, 5 Dec 2023 19:13:41 +0000 Subject: [PATCH 01/16] NBI component - IETF Network plugin: - Implemented skeleton of plugin - Added test scenario - Added new requirements - Extended MockContext to properly link/unlink topologies, services and slices to contexts --- scripts/run_tests_locally-nbi.sh | 5 +- src/common/tests/MockServicerImpl_Context.py | 63 +- src/nbi/requirements.in | 1 + src/nbi/service/__main__.py | 2 + .../nbi_plugins/ietf_network/Constants.py | 16 + .../nbi_plugins/ietf_network/Networks.py | 68 + .../nbi_plugins/ietf_network/__init__.py | 39 + .../ietf_network/build-yang-bindings.sh | 37 + .../yang/iana-routing-types@2017-12-04.yang | 473 +++ .../yang/ietf-inet-types@2013-07-15.yang | 459 +++ .../yang/ietf-layer1-types@2022-10-14.yang | 1414 +++++++ .../ietf-network-topology@2018-02-26.yang | 294 ++ .../yang/ietf-network@2018-02-26.yang | 193 + .../yang/ietf-otn-topology@2023-07-06.yang | 2405 ++++++++++++ .../yang/ietf-routing-types@2017-12-04.yang | 774 ++++ .../yang/ietf-te-packet-types@2020-06-10.yang | 475 +++ .../yang/ietf-te-topology@2020-08-06.yang | 1952 ++++++++++ .../yang/ietf-te-types@2020-06-10.yang | 3379 +++++++++++++++++ .../yang/ietf-yang-types@2013-07-15.yang | 475 +++ src/nbi/tests/Constants.py | 4 +- src/nbi/tests/PrepareTestScenario.py | 53 +- src/nbi/tests/data/descriptor-topology.json | 201 + src/nbi/tests/data/test-ietf-network.json | 1944 ++++++++++ src/nbi/tests/test_ietf_network.py | 70 + 24 files changed, 14781 insertions(+), 15 deletions(-) create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/Constants.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/Networks.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/__init__.py create mode 100755 src/nbi/service/rest_server/nbi_plugins/ietf_network/build-yang-bindings.sh create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/iana-routing-types@2017-12-04.yang create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-inet-types@2013-07-15.yang create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-layer1-types@2022-10-14.yang create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-network-topology@2018-02-26.yang create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-network@2018-02-26.yang create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-otn-topology@2023-07-06.yang create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-routing-types@2017-12-04.yang create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-te-packet-types@2020-06-10.yang create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-te-topology@2020-08-06.yang create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-te-types@2020-06-10.yang create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-yang-types@2013-07-15.yang create mode 100644 src/nbi/tests/data/descriptor-topology.json create mode 100644 src/nbi/tests/data/test-ietf-network.json create mode 100644 src/nbi/tests/test_ietf_network.py diff --git a/scripts/run_tests_locally-nbi.sh b/scripts/run_tests_locally-nbi.sh index 1be045158..5c7b7bfa3 100755 --- a/scripts/run_tests_locally-nbi.sh +++ b/scripts/run_tests_locally-nbi.sh @@ -20,5 +20,8 @@ cd $PROJECTDIR/src RCFILE=$PROJECTDIR/coverage/.coveragerc # Run unitary tests and analyze coverage of code at same time +#coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ +# nbi/tests/test_unitary.py + coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ - nbi/tests/test_unitary.py + nbi/tests/test_ietf_network.py diff --git a/src/common/tests/MockServicerImpl_Context.py b/src/common/tests/MockServicerImpl_Context.py index 55f87b7b0..837445b5a 100644 --- a/src/common/tests/MockServicerImpl_Context.py +++ b/src/common/tests/MockServicerImpl_Context.py @@ -143,17 +143,34 @@ class MockServicerImpl_Context(ContextServiceServicer): def SetTopology(self, request: Topology, context : grpc.ServicerContext) -> TopologyId: LOGGER.debug('[SetTopology] request={:s}'.format(grpc_message_to_json_string(request))) - container_name = 'topology[{:s}]'.format(str(request.topology_id.context_id.context_uuid.uuid)) + context_uuid = str(request.topology_id.context_id.context_uuid.uuid) + container_name = 'topology[{:s}]'.format(context_uuid) topology_uuid = request.topology_id.topology_uuid.uuid reply,_ = self._set(request, container_name, topology_uuid, 'topology_id', TOPIC_TOPOLOGY) + + context_ = self.obj_db.get_entry('context', context_uuid, context) + for _topology_id in context_.topology_ids: + if _topology_id.topology_uuid.uuid == topology_uuid: break + else: + # topology not found, add it + context_.topology_ids.add().topology_uuid.uuid = topology_uuid + LOGGER.debug('[SetTopology] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply def RemoveTopology(self, request: TopologyId, context : grpc.ServicerContext) -> Empty: LOGGER.debug('[RemoveTopology] request={:s}'.format(grpc_message_to_json_string(request))) - container_name = 'topology[{:s}]'.format(str(request.context_id.context_uuid.uuid)) + context_uuid = str(request.context_id.context_uuid.uuid) + container_name = 'topology[{:s}]'.format(context_uuid) topology_uuid = request.topology_uuid.uuid reply = self._del(request, container_name, topology_uuid, 'topology_id', TOPIC_TOPOLOGY, context) + + context_ = self.obj_db.get_entry('context', context_uuid, context) + for _topology_id in context_.topology_ids: + if _topology_id.topology_uuid.uuid == topology_uuid: + context_.topology_ids.remove(_topology_id) + break + LOGGER.debug('[RemoveTopology] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply @@ -368,17 +385,34 @@ class MockServicerImpl_Context(ContextServiceServicer): def SetSlice(self, request: Slice, context : grpc.ServicerContext) -> SliceId: LOGGER.debug('[SetSlice] request={:s}'.format(grpc_message_to_json_string(request))) - container_name = 'slice[{:s}]'.format(str(request.slice_id.context_id.context_uuid.uuid)) + context_uuid = str(request.slice_id.context_id.context_uuid.uuid) + container_name = 'slice[{:s}]'.format(context_uuid) slice_uuid = request.slice_id.slice_uuid.uuid reply,_ = self._set(request, container_name, slice_uuid, 'slice_id', TOPIC_SLICE) + + context_ = self.obj_db.get_entry('context', context_uuid, context) + for _slice_id in context_.slice_ids: + if _slice_id.slice_uuid.uuid == slice_uuid: break + else: + # slice not found, add it + context_.slice_ids.add().slice_uuid.uuid = slice_uuid + LOGGER.debug('[SetSlice] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply def RemoveSlice(self, request: SliceId, context : grpc.ServicerContext) -> Empty: LOGGER.debug('[RemoveSlice] request={:s}'.format(grpc_message_to_json_string(request))) - container_name = 'slice[{:s}]'.format(str(request.context_id.context_uuid.uuid)) + context_uuid = str(request.slice_id.context_id.context_uuid.uuid) + container_name = 'slice[{:s}]'.format(context_uuid) slice_uuid = request.slice_uuid.uuid reply = self._del(request, container_name, slice_uuid, 'slice_id', TOPIC_SLICE, context) + + context_ = self.obj_db.get_entry('context', context_uuid, context) + for _slice_id in context_.slice_ids: + if _slice_id.slice_uuid.uuid == slice_uuid: + context_.slice_ids.remove(_slice_id) + break + LOGGER.debug('[RemoveSlice] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply @@ -443,17 +477,34 @@ class MockServicerImpl_Context(ContextServiceServicer): def SetService(self, request: Service, context : grpc.ServicerContext) -> ServiceId: LOGGER.debug('[SetService] request={:s}'.format(grpc_message_to_json_string(request))) - container_name = 'service[{:s}]'.format(str(request.service_id.context_id.context_uuid.uuid)) + context_uuid = str(request.service_id.context_id.context_uuid.uuid) + container_name = 'service[{:s}]'.format(context_uuid) service_uuid = request.service_id.service_uuid.uuid reply,_ = self._set(request, container_name, service_uuid, 'service_id', TOPIC_SERVICE) + + context_ = self.obj_db.get_entry('context', context_uuid, context) + for _service_id in context_.service_ids: + if _service_id.service_uuid.uuid == service_uuid: break + else: + # service not found, add it + context_.service_ids.add().service_uuid.uuid = service_uuid + LOGGER.debug('[SetService] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply def RemoveService(self, request: ServiceId, context : grpc.ServicerContext) -> Empty: LOGGER.debug('[RemoveService] request={:s}'.format(grpc_message_to_json_string(request))) - container_name = 'service[{:s}]'.format(str(request.context_id.context_uuid.uuid)) + context_uuid = str(request.service_id.context_id.context_uuid.uuid) + container_name = 'service[{:s}]'.format(context_uuid) service_uuid = request.service_uuid.uuid reply = self._del(request, container_name, service_uuid, 'service_id', TOPIC_SERVICE, context) + + context_ = self.obj_db.get_entry('context', context_uuid, context) + for _service_id in context_.service_ids: + if _service_id.service_uuid.uuid == service_uuid: + context_.service_ids.remove(_service_id) + break + LOGGER.debug('[RemoveService] reply={:s}'.format(grpc_message_to_json_string(reply))) return reply diff --git a/src/nbi/requirements.in b/src/nbi/requirements.in index dc22f64eb..63f39a3cf 100644 --- a/src/nbi/requirements.in +++ b/src/nbi/requirements.in @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +deepdiff==6.7.* Flask==2.1.3 Flask-HTTPAuth==4.5.0 Flask-RESTful==0.3.9 diff --git a/src/nbi/service/__main__.py b/src/nbi/service/__main__.py index 1b6fb6e87..07cc9193d 100644 --- a/src/nbi/service/__main__.py +++ b/src/nbi/service/__main__.py @@ -23,6 +23,7 @@ from .rest_server.RestServer import RestServer from .rest_server.nbi_plugins.debug_api import register_debug_api from .rest_server.nbi_plugins.etsi_bwm import register_etsi_bwm_api from .rest_server.nbi_plugins.ietf_l2vpn import register_ietf_l2vpn +from .rest_server.nbi_plugins.ietf_network import register_ietf_network from .rest_server.nbi_plugins.ietf_network_slice import register_ietf_nss terminate = threading.Event() @@ -63,6 +64,7 @@ def main(): register_debug_api(rest_server) register_etsi_bwm_api(rest_server) register_ietf_l2vpn(rest_server) # Registering L2VPN entrypoint + register_ietf_network(rest_server) register_ietf_nss(rest_server) # Registering NSS entrypoint rest_server.start() diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/Constants.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/Constants.py new file mode 100644 index 000000000..555a5f8f5 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/Constants.py @@ -0,0 +1,16 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + +PROVIDER_ID = 10 +CLIENT_ID = 0 diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/Networks.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/Networks.py new file mode 100644 index 000000000..a46f13f3f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/Networks.py @@ -0,0 +1,68 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + +import json, logging +from flask import request +from flask.json import jsonify +from flask_restful import Resource +#from common.tools.context_queries.Slice import get_slice_by_uuid +import pyangbind.lib.pybindJSON as pybindJSON +from context.client.ContextClient import ContextClient +from nbi.service.rest_server.nbi_plugins.ietf_network.Constants import CLIENT_ID, PROVIDER_ID +from nbi.service.rest_server.nbi_plugins.tools.Authentication import HTTP_AUTH +from nbi.service.rest_server.nbi_plugins.tools.HttpStatusCodes import HTTP_OK, HTTP_SERVERERROR +from .bindings import ietf_network, ietf_otn_topology + +LOGGER = logging.getLogger(__name__) + +class Networks(Resource): + @HTTP_AUTH.login_required + def get(self): + LOGGER.info('Request: {:s}'.format(str(request))) + topology_id = '' + try: + context_client = ContextClient() + #target = get_slice_by_uuid(context_client, vpn_id, rw_copy=True) + #if target is None: + # raise Exception('VPN({:s}) not found in database'.format(str(vpn_id))) + + ietf_net = ietf_network() + + ietf_otn = ietf_otn_topology() + ietf_otn. + + net1 = ietf_net.networks.network.add('providerId-10-clientId-0-topologyId-1') + net1.te.name = 'Huawei-Network' + net1.te_topology_identifier.provider_id = PROVIDER_ID + net1.te_topology_identifier.client_id = CLIENT_ID + net1.te_topology_identifier.topology_id = '1' + net1.network_types.te_topology._set_presence() + net1.network_types.te_topology.otn_topology._set_presence() + + net2 = ietf_net.networks.network.add('providerId-10-clientId-0-topologyId-2') + net2.te.name = 'Huawei-Network' + net2.te_topology_identifier.provider_id = PROVIDER_ID + net2.te_topology_identifier.client_id = CLIENT_ID + net2.te_topology_identifier.topology_id = '2' + + + + # TODO: improve this workaround to enhance performance + response = jsonify(json.loads(pybindJSON.dumps(ietf_net, mode='ietf'))) + response.status_code = HTTP_OK + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('Something went wrong Retrieving Topology({:s})'.format(str(topology_id))) + response = jsonify({'error': str(e)}) + response.status_code = HTTP_SERVERERROR + return response diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/__init__.py new file mode 100644 index 000000000..a17e52f43 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/__init__.py @@ -0,0 +1,39 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + +# RFC 8795 - YANG Data Model for Traffic Engineering (TE) Topologies +# Ref: https://datatracker.ietf.org/doc/html/rfc8795 + +# RFC 8776 - Common YANG Data Types for Traffic Engineering +# Ref: https://datatracker.ietf.org/doc/html/rfc8776 + +# RFC 8345 - A YANG Data Model for Network Topologies +# Ref: https://datatracker.ietf.org/doc/html/rfc8345 + +# RFC 6991 - Common YANG Data Types +# Ref: https://datatracker.ietf.org/doc/html/rfc6991 + + +from flask_restful import Resource +from nbi.service.rest_server.RestServer import RestServer +from .Networks import Networks + +URL_PREFIX = '/restconf/data/ietf-network:networks' + +def _add_resource(rest_server : RestServer, resource : Resource, *urls, **kwargs): + urls = [(URL_PREFIX + url) for url in urls] + rest_server.add_resource(resource, *urls, **kwargs) + +def register_ietf_network(rest_server : RestServer): + _add_resource(rest_server, Networks, '/') diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/build-yang-bindings.sh b/src/nbi/service/rest_server/nbi_plugins/ietf_network/build-yang-bindings.sh new file mode 100755 index 000000000..2828de91c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/build-yang-bindings.sh @@ -0,0 +1,37 @@ +#!/bin/bash +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + +BASE_PATH=~/tfs-ctrl/src/nbi/service/rest_server/nbi_plugins/ietf_network +IETF_MODELS_PATH=${BASE_PATH}/yang + +cd ${BASE_PATH} +export PYBINDPLUGIN=`/usr/bin/env python -c 'import pyangbind; import os; print ("{}/plugin".format(os.path.dirname(pyangbind.__file__)))'` + +# -p ${OC_HERCULES_MODELS_PATH}/ +# --split-class-dir openconfig_hercules +# --presence +pyang --plugindir $PYBINDPLUGIN -p ${IETF_MODELS_PATH}/ -f pybind --split-class-dir bindings \ + ${IETF_MODELS_PATH}/ietf-network-topology@2018-02-26.yang \ + ${IETF_MODELS_PATH}/ietf-network@2018-02-26.yang \ + ${IETF_MODELS_PATH}/ietf-te-topology@2020-08-06.yang \ + ${IETF_MODELS_PATH}/ietf-otn-topology@2023-07-06.yang + +# ${IETF_MODELS_PATH}/iana-routing-types@2017-12-04.yang \ +# ${IETF_MODELS_PATH}/ietf-inet-types@2013-07-15.yang \ +# ${IETF_MODELS_PATH}/ietf-layer1-types@2022-10-14.yang \ +# ${IETF_MODELS_PATH}/ietf-routing-types@2017-12-04.yang \ +# ${IETF_MODELS_PATH}/ietf-te-packet-types@2020-06-10.yang \ +# ${IETF_MODELS_PATH}/ietf-te-types@2020-06-10.yang \ +# ${IETF_MODELS_PATH}/ietf-yang-types@2013-07-15.yang \ diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/iana-routing-types@2017-12-04.yang b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/iana-routing-types@2017-12-04.yang new file mode 100644 index 000000000..250cba4b6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/iana-routing-types@2017-12-04.yang @@ -0,0 +1,473 @@ + module iana-routing-types { + namespace "urn:ietf:params:xml:ns:yang:iana-routing-types"; + prefix iana-rt-types; + + organization + "IANA"; + contact + "Internet Assigned Numbers Authority + + Postal: ICANN + 12025 Waterfront Drive, Suite 300 + Los Angeles, CA 90094-2536 + United States of America + Tel: +1 310 301 5800 + "; + + description + "This module contains a collection of YANG data types + considered defined by IANA and used for routing + protocols. + + Copyright (c) 2017 IETF Trust and the persons + identified as authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (https://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 8294; see + the RFC itself for full legal notices."; + + revision 2017-12-04 { + description "Initial revision."; + reference + "RFC 8294: Common YANG Data Types for the Routing Area. + Section 4."; + } + + /*** Collection of IANA types related to routing ***/ + /*** IANA Address Family enumeration ***/ + + typedef address-family { + type enumeration { + enum ipv4 { + value 1; + description + "IPv4 Address Family."; + } + + enum ipv6 { + value 2; + description + "IPv6 Address Family."; + } + + enum nsap { + value 3; + description + "OSI Network Service Access Point (NSAP) Address Family."; + } + + enum hdlc { + value 4; + description + "High-Level Data Link Control (HDLC) Address Family."; + } + + enum bbn1822 { + value 5; + description + "Bolt, Beranek, and Newman Report 1822 (BBN 1822) + Address Family."; + } + + enum ieee802 { + value 6; + description + "IEEE 802 Committee Address Family + (aka Media Access Control (MAC) address)."; + } + + enum e163 { + value 7; + description + "ITU-T E.163 Address Family."; + } + + enum e164 { + value 8; + description + "ITU-T E.164 (Switched Multimegabit Data Service (SMDS), + Frame Relay, ATM) Address Family."; + } + + enum f69 { + value 9; + description + "ITU-T F.69 (Telex) Address Family."; + } + + enum x121 { + value 10; + description + "ITU-T X.121 (X.25, Frame Relay) Address Family."; + } + + enum ipx { + value 11; + description + "Novell Internetwork Packet Exchange (IPX) + Address Family."; + } + + enum appletalk { + value 12; + description + "Apple AppleTalk Address Family."; + } + + enum decnet-iv { + value 13; + description + "Digital Equipment DECnet Phase IV Address Family."; + } + + enum vines { + value 14; + description + "Banyan Vines Address Family."; + } + + enum e164-nsap { + value 15; + description + "ITU-T E.164 with NSAP sub-address Address Family."; + } + + enum dns { + value 16; + description + "Domain Name System (DNS) Address Family."; + } + + enum distinguished-name { + value 17; + description + "Distinguished Name Address Family."; + } + + enum as-num { + value 18; + description + "Autonomous System (AS) Number Address Family."; + } + + enum xtp-v4 { + value 19; + description + "Xpress Transport Protocol (XTP) over IPv4 + Address Family."; + } + + enum xtp-v6 { + value 20; + description + "XTP over IPv6 Address Family."; + } + + enum xtp-native { + value 21; + description + "XTP native mode Address Family."; + } + + enum fc-port { + value 22; + description + "Fibre Channel (FC) World-Wide Port Name Address Family."; + } + + enum fc-node { + value 23; + description + "FC World-Wide Node Name Address Family."; + } + + enum gwid { + value 24; + description + "ATM Gateway Identifier (GWID) Number Address Family."; + } + + enum l2vpn { + value 25; + description + "Layer 2 VPN (L2VPN) Address Family."; + } + + enum mpls-tp-section-eid { + value 26; + description + "MPLS Transport Profile (MPLS-TP) Section Endpoint + Identifier Address Family."; + } + + enum mpls-tp-lsp-eid { + value 27; + description + "MPLS-TP Label Switched Path (LSP) Endpoint Identifier + Address Family."; + } + + enum mpls-tp-pwe-eid { + value 28; + description + "MPLS-TP Pseudowire Endpoint Identifier Address Family."; + } + + enum mt-v4 { + value 29; + description + "Multi-Topology IPv4 Address Family."; + } + + enum mt-v6 { + value 30; + description + "Multi-Topology IPv6 Address Family."; + } + + enum eigrp-common-sf { + value 16384; + description + "Enhanced Interior Gateway Routing Protocol (EIGRP) + Common Service Family Address Family."; + } + + enum eigrp-v4-sf { + value 16385; + description + "EIGRP IPv4 Service Family Address Family."; + } + + enum eigrp-v6-sf { + value 16386; + description + "EIGRP IPv6 Service Family Address Family."; + } + + enum lcaf { + value 16387; + description + "Locator/ID Separation Protocol (LISP) + Canonical Address Format (LCAF) Address Family."; + } + + enum bgp-ls { + value 16388; + description + "Border Gateway Protocol - Link State (BGP-LS) + Address Family."; + } + + enum mac-48 { + value 16389; + description + "IEEE 48-bit MAC Address Family."; + } + + enum mac-64 { + value 16390; + description + "IEEE 64-bit MAC Address Family."; + } + + enum trill-oui { + value 16391; + description + "Transparent Interconnection of Lots of Links (TRILL) + IEEE Organizationally Unique Identifier (OUI) + Address Family."; + } + + enum trill-mac-24 { + value 16392; + description + "TRILL final 3 octets of 48-bit MAC Address Family."; + } + + enum trill-mac-40 { + value 16393; + description + "TRILL final 5 octets of 64-bit MAC Address Family."; + } + + enum ipv6-64 { + value 16394; + description + "First 8 octets (64 bits) of IPv6 address + Address Family."; + } + + enum trill-rbridge-port-id { + value 16395; + description + "TRILL Routing Bridge (RBridge) Port ID Address Family."; + } + + enum trill-nickname { + value 16396; + description + "TRILL Nickname Address Family."; + } + } + + description + "Enumeration containing all the IANA-defined + Address Families."; + + } + + /*** Subsequent Address Family Identifiers (SAFIs) ***/ + /*** for multiprotocol BGP enumeration ***/ + + typedef bgp-safi { + type enumeration { + enum unicast-safi { + value 1; + description + "Unicast SAFI."; + } + + enum multicast-safi { + value 2; + description + "Multicast SAFI."; + } + + enum labeled-unicast-safi { + value 4; + description + "Labeled Unicast SAFI."; + } + + enum multicast-vpn-safi { + value 5; + description + "Multicast VPN SAFI."; + } + + enum pseudowire-safi { + value 6; + description + "Multi-segment Pseudowire VPN SAFI."; + } + + enum tunnel-encap-safi { + value 7; + description + "Tunnel Encap SAFI."; + } + + enum mcast-vpls-safi { + value 8; + description + "Multicast Virtual Private LAN Service (VPLS) SAFI."; + } + + enum tunnel-safi { + value 64; + description + "Tunnel SAFI."; + } + + enum vpls-safi { + value 65; + description + "VPLS SAFI."; + } + + enum mdt-safi { + value 66; + description + "Multicast Distribution Tree (MDT) SAFI."; + } + + enum v4-over-v6-safi { + value 67; + description + "IPv4 over IPv6 SAFI."; + } + + enum v6-over-v4-safi { + value 68; + description + "IPv6 over IPv4 SAFI."; + } + + enum l1-vpn-auto-discovery-safi { + value 69; + description + "Layer 1 VPN Auto-Discovery SAFI."; + } + + enum evpn-safi { + value 70; + description + "Ethernet VPN (EVPN) SAFI."; + } + + enum bgp-ls-safi { + value 71; + description + "BGP-LS SAFI."; + } + + enum bgp-ls-vpn-safi { + value 72; + description + "BGP-LS VPN SAFI."; + } + + enum sr-te-safi { + value 73; + description + "Segment Routing - Traffic Engineering (SR-TE) SAFI."; + } + + enum labeled-vpn-safi { + value 128; + description + "MPLS Labeled VPN SAFI."; + } + + enum multicast-mpls-vpn-safi { + value 129; + description + "Multicast for BGP/MPLS IP VPN SAFI."; + } + + enum route-target-safi { + value 132; + description + "Route Target SAFI."; + } + + enum ipv4-flow-spec-safi { + value 133; + description + "IPv4 Flow Specification SAFI."; + } + + enum vpnv4-flow-spec-safi { + value 134; + description + "IPv4 VPN Flow Specification SAFI."; + } + + enum vpn-auto-discovery-safi { + value 140; + description + "VPN Auto-Discovery SAFI."; + } + } + description + "Enumeration for BGP SAFI."; + reference + "RFC 4760: Multiprotocol Extensions for BGP-4."; + } + } diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-inet-types@2013-07-15.yang b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-inet-types@2013-07-15.yang new file mode 100644 index 000000000..790bafc31 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-inet-types@2013-07-15.yang @@ -0,0 +1,459 @@ + module ietf-inet-types { + + namespace "urn:ietf:params:xml:ns:yang:ietf-inet-types"; + prefix "inet"; + + organization + "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; + + contact + "WG Web: + WG List: + + WG Chair: David Kessens + + + WG Chair: Juergen Schoenwaelder + + + Editor: Juergen Schoenwaelder + "; + + description + "This module contains a collection of generally useful derived + YANG data types for Internet addresses and related things. + + Copyright (c) 2013 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 6991; see + the RFC itself for full legal notices."; + + revision 2013-07-15 { + description + "This revision adds the following new data types: + - ip-address-no-zone + - ipv4-address-no-zone + - ipv6-address-no-zone"; + reference + "RFC 6991: Common YANG Data Types"; + } + + revision 2010-09-24 { + description + "Initial revision."; + reference + "RFC 6021: Common YANG Data Types"; + } + + /*** collection of types related to protocol fields ***/ + + typedef ip-version { + type enumeration { + enum unknown { + value "0"; + description + "An unknown or unspecified version of the Internet + protocol."; + } + enum ipv4 { + value "1"; + description + "The IPv4 protocol as defined in RFC 791."; + } + enum ipv6 { + value "2"; + description + "The IPv6 protocol as defined in RFC 2460."; + } + } + description + "This value represents the version of the IP protocol. + + In the value set and its semantics, this type is equivalent + to the InetVersion textual convention of the SMIv2."; + reference + "RFC 791: Internet Protocol + RFC 2460: Internet Protocol, Version 6 (IPv6) Specification + RFC 4001: Textual Conventions for Internet Network Addresses"; + } + + typedef dscp { + type uint8 { + range "0..63"; + } + description + "The dscp type represents a Differentiated Services Code Point + that may be used for marking packets in a traffic stream. + + In the value set and its semantics, this type is equivalent + to the Dscp textual convention of the SMIv2."; + reference + "RFC 3289: Management Information Base for the Differentiated + Services Architecture + RFC 2474: Definition of the Differentiated Services Field + (DS Field) in the IPv4 and IPv6 Headers + RFC 2780: IANA Allocation Guidelines For Values In + the Internet Protocol and Related Headers"; + } + + typedef ipv6-flow-label { + type uint32 { + range "0..1048575"; + } + description + "The ipv6-flow-label type represents the flow identifier or Flow + Label in an IPv6 packet header that may be used to + discriminate traffic flows. + + In the value set and its semantics, this type is equivalent + to the IPv6FlowLabel textual convention of the SMIv2."; + reference + "RFC 3595: Textual Conventions for IPv6 Flow Label + RFC 2460: Internet Protocol, Version 6 (IPv6) Specification"; + } + + typedef port-number { + type uint16 { + range "0..65535"; + } + description + "The port-number type represents a 16-bit port number of an + Internet transport-layer protocol such as UDP, TCP, DCCP, or + SCTP. Port numbers are assigned by IANA. A current list of + all assignments is available from . + + Note that the port number value zero is reserved by IANA. In + situations where the value zero does not make sense, it can + be excluded by subtyping the port-number type. + In the value set and its semantics, this type is equivalent + to the InetPortNumber textual convention of the SMIv2."; + reference + "RFC 768: User Datagram Protocol + RFC 793: Transmission Control Protocol + RFC 4960: Stream Control Transmission Protocol + RFC 4340: Datagram Congestion Control Protocol (DCCP) + RFC 4001: Textual Conventions for Internet Network Addresses"; + } + + /*** collection of types related to autonomous systems ***/ + + typedef as-number { + type uint32; + description + "The as-number type represents autonomous system numbers + which identify an Autonomous System (AS). An AS is a set + of routers under a single technical administration, using + an interior gateway protocol and common metrics to route + packets within the AS, and using an exterior gateway + protocol to route packets to other ASes. IANA maintains + the AS number space and has delegated large parts to the + regional registries. + + Autonomous system numbers were originally limited to 16 + bits. BGP extensions have enlarged the autonomous system + number space to 32 bits. This type therefore uses an uint32 + base type without a range restriction in order to support + a larger autonomous system number space. + + In the value set and its semantics, this type is equivalent + to the InetAutonomousSystemNumber textual convention of + the SMIv2."; + reference + "RFC 1930: Guidelines for creation, selection, and registration + of an Autonomous System (AS) + RFC 4271: A Border Gateway Protocol 4 (BGP-4) + RFC 4001: Textual Conventions for Internet Network Addresses + RFC 6793: BGP Support for Four-Octet Autonomous System (AS) + Number Space"; + } + + /*** collection of types related to IP addresses and hostnames ***/ + + typedef ip-address { + type union { + type inet:ipv4-address; + type inet:ipv6-address; + } + description + "The ip-address type represents an IP address and is IP + version neutral. The format of the textual representation + implies the IP version. This type supports scoped addresses + by allowing zone identifiers in the address format."; + reference + "RFC 4007: IPv6 Scoped Address Architecture"; + } + + typedef ipv4-address { + type string { + pattern + '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}' + + '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])' + + '(%[\p{N}\p{L}]+)?'; + } + description + "The ipv4-address type represents an IPv4 address in + dotted-quad notation. The IPv4 address may include a zone + index, separated by a % sign. + + The zone index is used to disambiguate identical address + values. For link-local addresses, the zone index will + typically be the interface index number or the name of an + interface. If the zone index is not present, the default + zone of the device will be used. + + The canonical format for the zone index is the numerical + format"; + } + + typedef ipv6-address { + type string { + pattern '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}' + + '((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|' + + '(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}' + + '(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))' + + '(%[\p{N}\p{L}]+)?'; + pattern '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|' + + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)' + + '(%.+)?'; + } + description + "The ipv6-address type represents an IPv6 address in full, + mixed, shortened, and shortened-mixed notation. The IPv6 + address may include a zone index, separated by a % sign. + + The zone index is used to disambiguate identical address + values. For link-local addresses, the zone index will + typically be the interface index number or the name of an + interface. If the zone index is not present, the default + zone of the device will be used. + + The canonical format of IPv6 addresses uses the textual + representation defined in Section 4 of RFC 5952. The + canonical format for the zone index is the numerical + format as described in Section 11.2 of RFC 4007."; + reference + "RFC 4291: IP Version 6 Addressing Architecture + RFC 4007: IPv6 Scoped Address Architecture + RFC 5952: A Recommendation for IPv6 Address Text + Representation"; + } + + typedef ip-address-no-zone { + type union { + type inet:ipv4-address-no-zone; + type inet:ipv6-address-no-zone; + } + description + "The ip-address-no-zone type represents an IP address and is + IP version neutral. The format of the textual representation + implies the IP version. This type does not support scoped + addresses since it does not allow zone identifiers in the + address format."; + reference + "RFC 4007: IPv6 Scoped Address Architecture"; + } + + typedef ipv4-address-no-zone { + type inet:ipv4-address { + pattern '[0-9\.]*'; + } + description + "An IPv4 address without a zone index. This type, derived from + ipv4-address, may be used in situations where the zone is + known from the context and hence no zone index is needed."; + } + + typedef ipv6-address-no-zone { + type inet:ipv6-address { + pattern '[0-9a-fA-F:\.]*'; + } + description + "An IPv6 address without a zone index. This type, derived from + ipv6-address, may be used in situations where the zone is + known from the context and hence no zone index is needed."; + reference + "RFC 4291: IP Version 6 Addressing Architecture + RFC 4007: IPv6 Scoped Address Architecture + RFC 5952: A Recommendation for IPv6 Address Text + Representation"; + } + + typedef ip-prefix { + type union { + type inet:ipv4-prefix; + type inet:ipv6-prefix; + } + description + "The ip-prefix type represents an IP prefix and is IP + version neutral. The format of the textual representations + implies the IP version."; + } + + typedef ipv4-prefix { + type string { + pattern + '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}' + + '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])' + + '/(([0-9])|([1-2][0-9])|(3[0-2]))'; + } + description + "The ipv4-prefix type represents an IPv4 address prefix. + The prefix length is given by the number following the + slash character and must be less than or equal to 32. + + A prefix length value of n corresponds to an IP address + mask that has n contiguous 1-bits from the most + significant bit (MSB) and all other bits set to 0. + + The canonical format of an IPv4 prefix has all bits of + the IPv4 address set to zero that are not part of the + IPv4 prefix."; + } + + typedef ipv6-prefix { + type string { + pattern '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}' + + '((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|' + + '(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}' + + '(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))' + + '(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'; + pattern '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|' + + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)' + + '(/.+)'; + } + + description + "The ipv6-prefix type represents an IPv6 address prefix. + The prefix length is given by the number following the + slash character and must be less than or equal to 128. + + A prefix length value of n corresponds to an IP address + mask that has n contiguous 1-bits from the most + significant bit (MSB) and all other bits set to 0. + + The IPv6 address should have all bits that do not belong + to the prefix set to zero. + + The canonical format of an IPv6 prefix has all bits of + the IPv6 address set to zero that are not part of the + IPv6 prefix. Furthermore, the IPv6 address is represented + as defined in Section 4 of RFC 5952."; + reference + "RFC 5952: A Recommendation for IPv6 Address Text + Representation"; + } + + /*** collection of domain name and URI types ***/ + + typedef domain-name { + type string { + pattern + '((([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.)*' + + '([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.?)' + + '|\.'; + length "1..253"; + } + description + "The domain-name type represents a DNS domain name. The + name SHOULD be fully qualified whenever possible. + + Internet domain names are only loosely specified. Section + 3.5 of RFC 1034 recommends a syntax (modified in Section + 2.1 of RFC 1123). The pattern above is intended to allow + for current practice in domain name use, and some possible + future expansion. It is designed to hold various types of + domain names, including names used for A or AAAA records + (host names) and other records, such as SRV records. Note + that Internet host names have a stricter syntax (described + in RFC 952) than the DNS recommendations in RFCs 1034 and + 1123, and that systems that want to store host names in + schema nodes using the domain-name type are recommended to + adhere to this stricter standard to ensure interoperability. + + The encoding of DNS names in the DNS protocol is limited + to 255 characters. Since the encoding consists of labels + prefixed by a length bytes and there is a trailing NULL + byte, only 253 characters can appear in the textual dotted + notation. + + The description clause of schema nodes using the domain-name + type MUST describe when and how these names are resolved to + IP addresses. Note that the resolution of a domain-name value + may require to query multiple DNS records (e.g., A for IPv4 + and AAAA for IPv6). The order of the resolution process and + which DNS record takes precedence can either be defined + explicitly or may depend on the configuration of the + resolver. + + Domain-name values use the US-ASCII encoding. Their canonical + format uses lowercase US-ASCII characters. Internationalized + domain names MUST be A-labels as per RFC 5890."; + reference + "RFC 952: DoD Internet Host Table Specification + RFC 1034: Domain Names - Concepts and Facilities + RFC 1123: Requirements for Internet Hosts -- Application + and Support + RFC 2782: A DNS RR for specifying the location of services + (DNS SRV) + RFC 5890: Internationalized Domain Names in Applications + (IDNA): Definitions and Document Framework"; + } + + typedef host { + type union { + type inet:ip-address; + type inet:domain-name; + } + description + "The host type represents either an IP address or a DNS + domain name."; + } + + typedef uri { + type string; + description + "The uri type represents a Uniform Resource Identifier + (URI) as defined by STD 66. + + Objects using the uri type MUST be in US-ASCII encoding, + and MUST be normalized as described by RFC 3986 Sections + 6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary + percent-encoding is removed, and all case-insensitive + characters are set to lowercase except for hexadecimal + digits, which are normalized to uppercase as described in + Section 6.2.2.1. + + The purpose of this normalization is to help provide + unique URIs. Note that this normalization is not + sufficient to provide uniqueness. Two URIs that are + textually distinct after this normalization may still be + equivalent. + + Objects using the uri type may restrict the schemes that + they permit. For example, 'data:' and 'urn:' schemes + might not be appropriate. + + A zero-length URI is not a valid URI. This can be used to + express 'URI absent' where required. + + In the value set and its semantics, this type is equivalent + to the Uri SMIv2 textual convention defined in RFC 5017."; + reference + "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax + RFC 3305: Report from the Joint W3C/IETF URI Planning Interest + Group: Uniform Resource Identifiers (URIs), URLs, + and Uniform Resource Names (URNs): Clarifications + and Recommendations + RFC 5017: MIB Textual Conventions for Uniform Resource + Identifiers (URIs)"; + } + + } diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-layer1-types@2022-10-14.yang b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-layer1-types@2022-10-14.yang new file mode 100644 index 000000000..188336931 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-layer1-types@2022-10-14.yang @@ -0,0 +1,1414 @@ + module ietf-layer1-types { + yang-version 1.1; + namespace "urn:ietf:params:xml:ns:yang:ietf-layer1-types"; + prefix "l1-types"; + + import ietf-routing-types { + prefix rt-types; + reference + "RFC 8294: Common YANG Data Types for the Routing Area"; + } + + organization + "IETF CCAMP Working Group"; + contact + "WG Web: + WG List: + + Editor: Haomian Zheng + + + Editor: Italo Busi + "; + + description + "This module defines Layer 1 types. The model fully conforms + to the Network Management Datastore Architecture (NMDA). + + Copyright (c) 2022 IETF Trust and the persons + identified as authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Revised BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (https://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC XXXX; see + the RFC itself for full legal notices. + + The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL + NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED', + 'MAY', and 'OPTIONAL' in this document are to be interpreted as + described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, + + + + + they appear in all capitals, as shown here."; + + revision "2022-10-14" { + description + "Initial Version"; + reference + "RFC XXXX: A YANG Data Model for Layer 1 Types"; + // RFC Editor: replace XXXX with actual RFC number, update date + // information and remove this note + } + + /* + * Identities + */ + + identity tributary-slot-granularity { + description + "Tributary Slot Granularity (TSG)"; + reference + "ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN)"; + } + + identity tsg-1.25G { + base tributary-slot-granularity; + description + "1.25G tributary slot granularity"; + } + + identity tsg-2.5G { + base tributary-slot-granularity; + description + "2.5G tributary slot granularity"; + } + + identity tsg-5G { + base tributary-slot-granularity; + description + "5G tributary slot granularity"; + } + + identity odu-type { + description + "Base identity from which specific Optical Data Unit (ODU) + type is derived."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + + + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN)"; + } + + identity ODU0 { + base odu-type; + description + "ODU0 type (1.24Gb/s)."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN)"; + } + + identity ODU1 { + base odu-type; + description + "ODU1 type (2.49Gb/s)."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN)"; + } + + identity ODU2 { + base odu-type; + description + "ODU2 type (10.03Gb/s)."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN)"; + } + + identity ODU2e { + base odu-type; + description + "ODU2e type (10.39Gb/s)."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + + + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN)"; + } + + identity ODU3 { + base odu-type; + description + "ODU3 type (40.31Gb/s)."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN)"; + } + + identity ODU4 { + base odu-type; + description + "ODU4 type (104.79Gb/s)."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN)"; + } + + identity ODUflex { + base odu-type; + description + "ODUflex type (flexible bit rate, not resizable). + + It could be used for any type of ODUflex, including + ODUflex(CBR), ODUflex(GFP), ODUflex(GFP,n,k), ODUflex(IMP,s), + ODUflex(IMP) and ODUflex(FlexE-aware)."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN)"; + } + + identity ODUflex-resizable { + base odu-type; + description + "ODUflex protocol (flexible bit rate, resizable). + + + + + It could be used only for ODUflex(GFP,n,k)."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN)"; + } + + identity protocol { + description + "Base identity from which specific protocol is derived."; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity Ethernet { + base protocol; + description + "Ethernet protocol."; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity Fibre-Channel { + base protocol; + description + "Fibre-Channel (FC) protocol."; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity SDH { + base protocol; + description + "SDH protocol."; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity SONET { + base protocol; + description + "SONET protocol."; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + + + + identity client-signal { + description + "Base identity from which specific Constant Bit Rate (CBR) + client signal is derived"; + } + + identity coding-func { + description + "Base identity from which specific coding function + is derived."; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity ETH-1Gb { + base client-signal; + description + "Client signal type of 1GbE"; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN)"; + } + + identity ETH-10Gb-LAN { + base client-signal; + description + "Client signal type of ETH-10Gb-LAN (10.3 Gb/s)"; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN) + + IEEE 802.3-2018, Clause 49: IEEE Standard for Ethernet"; + } + + identity ETH-10Gb-WAN { + base client-signal; + description + "Client signal type of ETH-10Gb-WAN (9.95 Gb/s)"; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + + + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN) + + IEEE 802.3-2018, Clause 50: IEEE Standard for Ethernet"; + } + + identity ETH-40Gb { + base client-signal; + description + "Client signal type of 40GbE"; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN)"; + } + + identity ETH-100Gb { + base client-signal; + description + "Client signal type of 100GbE"; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN)"; + } + + identity STM-1 { + base client-signal; + base coding-func; + description + "Client signal type of STM-1; + STM-1 G.707 (N=1) coding function."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN) + + MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity STM-4 { + base client-signal; + + + + + base coding-func; + description + "Client signal type of STM-4; + STM-4 G.707 (N=4) coding function."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN) + + MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity STM-16 { + base client-signal; + base coding-func; + description + "Client signal type of STM-16; + STM-16 G.707 (N=16) coding function."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN) + + MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity STM-64 { + base client-signal; + base coding-func; + description + "Client signal type of STM-64; + STM-64 G.707 (N=64) coding function."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN) + + MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity STM-256 { + base client-signal; + + + + + base coding-func; + description + "Client signal type of STM-256; + STM-256 G.707 (N=256) coding function."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN) + + MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity OC-3 { + base client-signal; + base coding-func; + description + "Client signal type of OC3; + OC-3 GR-253-CORE (N=3) coding function."; + reference + "ANSI T1.105-1995: Synchronous Optical Network (SONET) + Basic Description including Multiplex Structure, Rates, + and Formats + + MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity OC-12 { + base client-signal; + base coding-func; + description + "Client signal type of OC12; + OC-12 GR-253-CORE (N=12) coding function."; + reference + "ANSI T1.105-1995: Synchronous Optical Network (SONET) + Basic Description including Multiplex Structure, Rates, + and Formats + + MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity OC-48 { + base client-signal; + base coding-func; + description + "Client signal type of OC48; + OC-48 GR-253-CORE (N=48) coding function."; + + + + + reference + "ANSI T1.105-1995: Synchronous Optical Network (SONET) + Basic Description including Multiplex Structure, Rates, + and Formats + + MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity OC-192 { + base client-signal; + base coding-func; + description + "Client signal type of OC192; + OC-192 GR-253-CORE (N=192) coding function."; + reference + "ANSI T1.105-1995: Synchronous Optical Network (SONET) + Basic Description including Multiplex Structure, Rates, + and Formats + + MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity OC-768 { + base client-signal; + base coding-func; + description + "Client signal type of OC768; + OC-768 GR-253-CORE (N=768) coding function."; + reference + "ANSI T1.105-1995: Synchronous Optical Network (SONET) + Basic Description including Multiplex Structure, Rates, + and Formats + + MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity FC-100 { + base client-signal; + base coding-func; + description + "Client signal type of Fibre Channel FC-100; + FC-100 FC-FS-2 (1.0625 Gb/s) coding function."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN) + + + + + MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity FC-200 { + base client-signal; + base coding-func; + description + "Client signal type of Fibre Channel FC-200; + FC-200 FC-FS-2 (2.125 Gb/s) coding function."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN) + + MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity FC-400 { + base client-signal; + base coding-func; + description + "Client signal type of Fibre Channel FC-400; + FC-400 FC-FS-2 (4.250 Gb/s) coding function."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN) + + MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity FC-800 { + base client-signal; + base coding-func; + description + "Client signal type of Fibre Channel FC-800; + FC-800 FC-FS-2 (8.500 Gb/s) coding function."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN) + + + + + MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity FC-1200 { + base client-signal; + base coding-func; + description + "Client signal type of Fibre Channel FC-1200; + FC-1200 FC-10GFC (10.51875 Gb/s) coding function."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN) + + MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity FC-1600 { + base client-signal; + base coding-func; + description + "Client signal type of Fibre Channel FC-1600; + FC-1600 FC-FS-3 (14.025 Gb/s) coding function."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN) + + MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity FC-3200 { + base client-signal; + base coding-func; + description + "Client signal type of Fibre Channel FC-3200; + FC-3200 FC-FS-4 (28.05 Gb/s) coding function."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN) + + + + + MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity FICON-4G { + base client-signal; + description + "Client signal type of Fibre Connection 4G"; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN)"; + } + + identity FICON-8G { + base client-signal; + description + "Client signal type of Fibre Connection 8G"; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks + + ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN)"; + } + + identity ETH-1000X { + base coding-func; + description + "1000BASE-X PCS clause 36 coding function."; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity ETH-10GW { + base coding-func; + description + "10GBASE-W (WAN PHY) PCS clause 49 and WIS clause 50 + coding function."; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity ETH-10GR { + base coding-func; + description + "10GBASE-R (LAN PHY) PCS clause 49 coding function."; + + + + + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity ETH-40GR { + base coding-func; + description + "40GBASE-R PCS clause 82 coding function."; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity ETH-100GR { + base coding-func; + description + "100GBASE-R PCS clause 82 coding function."; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity optical-interface-func { + description + "Base identity from which optical-interface-function + is derived."; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity SX-PMD-1000 { + base optical-interface-func; + description + "SX-PMD-clause-38 Optical Interface function for + 1000BASE-X PCS-36"; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity LX-PMD-1000 { + base optical-interface-func; + description + "LX-PMD-clause-38 Optical Interface function for + 1000BASE-X PCS-36"; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity LX10-PMD-1000 { + base optical-interface-func; + + + + + description + "LX10-PMD-clause-59 Optical Interface function for + 1000BASE-X PCS-36"; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity BX10-PMD-1000 { + base optical-interface-func; + description + "BX10-PMD-clause-59 Optical Interface function for + 1000BASE-X PCS-36"; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity LW-PMD-10G { + base optical-interface-func; + description + "LW-PMD-clause-52 Optical Interface function for + 10GBASE-W PCS-49-WIS-50"; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity EW-PMD-10G { + base optical-interface-func; + description + "EW-PMD-clause-52 Optical Interface function for + 10GBASE-W PCS-49-WIS-50"; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity LR-PMD-10G { + base optical-interface-func; + description + "LR-PMD-clause-52 Optical Interface function for + 10GBASE-R PCS-49"; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity ER-PMD-10G { + base optical-interface-func; + description + "ER-PMD-clause-52 Optical Interface function for + 10GBASE-R PCS-49"; + + + + + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity LR4-PMD-40G { + base optical-interface-func; + description + "LR4-PMD-clause-87 Optical Interface function for + 40GBASE-R PCS-82"; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity ER4-PMD-40G { + base optical-interface-func; + description + "ER4-PMD-clause-87 Optical Interface function for + 40GBASE-R PCS-82"; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity FR-PMD-40G { + base optical-interface-func; + description + "FR-PMD-clause-89 Optical Interface function for + 40GBASE-R PCS-82"; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity LR4-PMD-100G { + base optical-interface-func; + description + "LR4-PMD-clause-88 Optical Interface function for + 100GBASE-R PCS-82"; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + identity ER4-PMD-100G { + base optical-interface-func; + description + "ER4-PMD-clause-88 Optical Interface function for + 100GBASE-R PCS-82"; + reference + "MEF63: Subscriber Layer 1 Service Attributes"; + } + + + + + /* + * Typedefs + */ + + typedef otn-tpn { + type uint16 { + range "1..4095"; + } + description + "Tributary Port Number (TPN) for OTN. "; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks."; + } + + typedef otn-ts { + type uint16 { + range "1..4095"; + } + description + "Tributary Slot (TS) for OTN."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of Evolving + G.709 Optical Transport Networks."; + } + + typedef otn-label-range-type { + type enumeration { + enum trib-slot { + description + "Defines a range of OTN tributary slots (TS)."; + } + enum trib-port { + description + "Defines a range of OTN tributary ports (TPN)."; + } + } + description + "Defines the type of OTN label range: TS or TPN. "; + } + + typedef gfp-k { + type enumeration { + enum 2 { + description + "The ODU2.ts rate (1,249,177.230 kbit/s) is used + to compute the rate of an ODUflex(GFP,n,2). "; + } + + + + + enum 3 { + description + "The ODU3.ts rate (1,254,470.354 kbit/s) is used + to compute the rate of an ODUflex(GFP,n,3). "; + } + enum 4 { + description + "The ODU4.ts rate (1,301,467.133 kbit/s) is used + to compute the rate of an ODUflex(GFP,n,4). "; + } + } + description + "The ODUk.ts used to compute the rate of an ODUflex(GFP,n,k)"; + reference + "ITU-T G.709 v6.0 (06/2020), Table 7-8 and L.7: Interfaces for + the Optical Transport Network (OTN)"; + } + + typedef flexe-client-rate { + type union { + type uint16; + type enumeration { + enum "10G" { + description + "Represents a 10G FlexE Client signal (s=2)"; + } + enum "40G" { + description + "Represents a 40G FlexE Client signal (s=8)"; + } + } + } + description + "The FlexE Client signal rate (s x 5,156,250.000 kbit/s) + used to compute the rate of an ODUflex(IMP, s). + Valid values for s are s=2 (10G), s=4 (40G) and + s=5 x n (n x 25G). + In the first two cases an enumeration value + (either 10G or 40G) is used, while in the latter case + the value of n is used"; + reference + "ITU-T G.709 v6.0 (06/2020), Table 7-2: Interfaces for the + Optical Transport Network (OTN)"; + } + + typedef odtu-flex-type { + type enumeration { + enum "2" { + + + + + description + "The ODTU2.ts ODTU type."; + } + enum "3" { + description + "The ODTU3.ts ODTU type."; + } + enum "4" { + description + "The ODTU4.ts ODTU type."; + } + enum "Cn" { + description + "The ODTUCn.ts ODTU type."; + } + } + description + "The type of Optical Data Tributary Unit (ODTU), + whose nominal bitrate is used to compute the number of + Tributary Slots (TS) required by an ODUflex LSP, according to + the (19-1a) and (20-1a) formulas defined in G.709."; + reference + "ITU-T G.709 v6.0 (06/2020), Table 7-7, clause 19.6 and + clause 20.5: Interfaces for the Optical Transport + Network (OTN)"; + } + + typedef bandwidth-scientific-notation { + type string { + pattern + '0(\.0?)?([eE](\+)?0?)?|' + + '[1-9](\.[0-9]{0,6})?[eE](\+)?(9[0-6]|[1-8][0-9]|0?[0-9])?'; + } + units "bps"; + description + "Bandwidth values, expressed using the scientific notation + in bits per second. + + The encoding format is the external decimal-significant + character sequences specified in IEEE 754 and ISO/IEC C99 + for 32-bit decimal floating-point numbers: + (-1)**(S) * 10**(Exponent) * (Significant), + where Significant uses 7 digits. + + An implementation for this representation MAY use decimal32 + or binary32. The range of the Exponent is from -95 to +96 + for decimal32, and from -38 to +38 for binary32. + As a bandwidth value, the format is restricted to be + + + + + normalized, non-negative, and non-fraction: + n.dddddde{+}dd, N.DDDDDDE{+}DD, 0e0 or 0E0, + where 'd' and 'D' are decimal digits; 'n' and 'N' are + non-zero decimal digits; 'e' and 'E' indicate a power of ten. + Some examples are 0e0, 1e10, and 9.953e9."; + reference + "IEEE Std 754-2008: IEEE Standard for Floating-Point + Arithmetic. + ISO/IEC C99: Information technology - Programming + Languages - C."; + } + + /* + * Groupings + */ + + grouping otn-link-bandwidth { + description + "Bandwidth attributes for OTN links"; + container otn { + description + "Bandwidth attributes for OTN links"; + list odulist { + key "odu-type"; + description + "OTN bandwidth definition"; + leaf odu-type { + type identityref { + base odu-type; + } + description "ODU type"; + } + leaf number { + type uint16; + description "Number of ODUs"; + } + leaf ts-number { + when 'derived-from-or-self(../odu-type,"ODUflex") or + derived-from-or-self(../odu-type, + "ODUflex-resizable")' { + description + "Applicable when odu-type is ODUflex or + ODUflex-resizable"; + } + type uint16 { + range "1..4095"; + } + description + + + + + "The number of Tributary Slots (TS) that + could be used by all the ODUflex LSPs."; + } + } + } + } + + grouping otn-path-bandwidth { + description + "Bandwidth attributes for OTN paths."; + container otn { + description + "Bandwidth attributes for OTN paths."; + leaf odu-type { + type identityref { + base odu-type; + } + description "ODU type"; + } + choice oduflex-type { + when 'derived-from-or-self(./odu-type,"ODUflex") or + derived-from-or-self(./odu-type, + "ODUflex-resizable")' { + description + "Applicable when odu-type is ODUflex or + ODUflex-resizable"; + } + description + "Types of ODUflex used to compute the ODUflex + nominal bit rate."; + reference + "ITU-T G.709 v6.0 (06/2020), Table 7-2: Interfaces for the + Optical Transport Network (OTN)"; + case generic { + leaf nominal-bit-rate { + type union { + type l1-types:bandwidth-scientific-notation; + type rt-types:bandwidth-ieee-float32; + } + mandatory true; + description + "Nominal ODUflex bit rate."; + } + } + case cbr { + leaf client-type { + type identityref { + base client-signal; + + + + + } + mandatory true; + description + "The type of Constant Bit Rate (CBR) client signal + of an ODUflex(CBR)."; + } + } + case gfp-n-k { + leaf gfp-n { + type uint8 { + range "1..80"; + } + mandatory true; + description + "The value of n for an ODUflex(GFP,n,k)."; + reference + "ITU-T G.709 v6.0 (06/2020), Tables 7-8 and L.7: + Interfaces for the Optical Transport Network (OTN)"; + } + leaf gfp-k { + type gfp-k; + description + "The value of k for an ODUflex(GFP,n,k). + + If omitted, it is calculated from the value of gfp-n + as described in Table 7-8 of G.709"; + reference + "ITU-T G.709 v6.0 (06/2020), Tables 7-8 and L.7: + Interfaces for the Optical Transport Network (OTN)"; + } + } + case flexe-client { + leaf flexe-client { + type flexe-client-rate; + mandatory true; + description + "The rate of the FlexE-client for an ODUflex(IMP,s)."; + } + } + case flexe-aware { + leaf flexe-aware-n { + type uint16; + mandatory true; + description + "The rate of FlexE-aware client signal + for ODUflex(FlexE-aware)"; + } + } + + + + + case packet { + leaf opuflex-payload-rate { + type union { + type l1-types:bandwidth-scientific-notation; + type rt-types:bandwidth-ieee-float32; + } + mandatory true; + description + "Either the GFP-F encapsulated packet client nominal + bit rate for an ODUflex(GFP) or the 64b/66b encoded + packet client nominal bit rate for an ODUflex(IMP)."; + } + } + } + } + } + + grouping otn-max-path-bandwidth { + description + "Maximum bandwidth attributes for OTN paths."; + container otn { + description + "Maximum bandwidth attributes for OTN paths."; + leaf odu-type { + type identityref { + base odu-type; + } + description "ODU type"; + } + leaf max-ts-number { + when 'derived-from-or-self(../odu-type,"ODUflex") or + derived-from-or-self(../odu-type, + "ODUflex-resizable")' { + description + "Applicable when odu-type is ODUflex or + ODUflex-resizable"; + } + type uint16 { + range "1..4095"; + } + description + "The maximum number of Tributary Slots (TS) that could be + used by an ODUflex LSP."; + } + } + } + + grouping otn-label-range-info { + + + + + description + "Label range information for OTN. + + This grouping SHOULD be used together with the + otn-label-start-end and otn-label-step groupings to provide + OTN technology-specific label information to the models which + use the label-restriction-info grouping defined in the module + ietf-te-types."; + container otn-label-range { + description + "Label range information for OTN."; + leaf range-type { + type otn-label-range-type; + description "The type of range (e.g., TPN or TS) + to which the label range applies"; + } + leaf tsg { + type identityref { + base tributary-slot-granularity; + } + description + "Tributary slot granularity (TSG) to which the label range + applies. + + This leaf MUST be present when the range-type is TS. + + This leaf MAY be omitted when mapping an ODUk over an OTUk + Link. In this case the range-type is tpn, with only one + entry (ODUk), and the tpn range has only one value (1)."; + reference + "ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN)"; + } + leaf-list odu-type-list { + type identityref { + base odu-type; + } + description + "List of ODU types to which the label range applies. + + An Empty odu-type-list means that the label range + applies to all the supported ODU types."; + } + leaf priority { + type uint8 { + range 0..7; + } + description + + + + + "Priority in Interface Switching Capability + Descriptor (ISCD)."; + reference + "RFC4203: OSPF Extensions in Support of Generalized + Multi-Protocol Label Switching (GMPLS)"; + } + } + } + + grouping otn-label-start-end { + description + "The OTN label-start or label-end used to specify an OTN label + range. + + This grouping is dependent on the range-type defined in the + otn-label-range-info grouping. + + This grouping SHOULD be used together with the + otn-label-range-info and otn-label-step groupings to provide + OTN technology-specific label information to the models which + use the label-restriction-info grouping defined in the module + ietf-te-types."; + container otn { + description + "Label start or label end for OTN."; + choice range-type { + description + "OTN label range type, either TPN range or TS range"; + case trib-port { + leaf tpn { + when "../../../../otn-label-range/range-type = + 'trib-port'" { + description + "Valid only when range-type represented by + trib-port"; + } + type otn-tpn; + description + "Tributary Port Number (TPN)."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of + Evolving G.709 Optical Transport Networks."; + } + } + case trib-slot { + leaf ts { + when "../../../../otn-label-range/range-type = + 'trib-slot'" { + + + + + description + "Valid only when range-type represented by + trib-slot"; + } + type otn-ts; + description + "Tributary Slot (TS) number."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of + Evolving G.709 Optical Transport Networks"; + } + } + } + } + } + + grouping otn-label-hop { + description "OTN Label"; + reference + "RFC7139, section 6: GMPLS Signaling Extensions for Control of + Evolving G.709 Optical Transport Networks"; + container otn { + description + "Label hop for OTN."; + leaf tpn { + type otn-tpn; + description + "Tributary Port Number (TPN)."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of + Evolving G.709 Optical Transport Networks."; + } + leaf tsg { + type identityref { + base tributary-slot-granularity; + } + description "Tributary Slot Granularity (TSG)."; + reference + "ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN)"; + } + leaf ts-list { + type string { + pattern "([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?" + + "(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)"; + } + description + "A list of available Tributary Slots (TS) ranging + + + + + between 1 and 4095. If multiple values or + ranges are given, they all MUST be disjoint + and MUST be in ascending order. + For example 1-20,25,50-1000."; + reference + "RFC 7139: GMPLS Signaling Extensions for Control + of Evolving G.709 Optical Transport Networks"; + } + } + } + + grouping otn-label-step { + description + "Label step for OTN. + + This grouping is dependent on the range-type defined in the + otn-label-range-info grouping. + + This grouping SHOULD be used together with the + otn-label-range-info and otn-label-start-end groupings to + provide OTN technology-specific label information to the + models which use the label-restriction-info grouping defined + in the module ietf-te-types."; + container otn { + description + "Label step for OTN"; + choice range-type { + description + "OTN label range type, either TPN range or TS range"; + case trib-port { + leaf tpn { + when "../../../otn-label-range/range-type = + 'trib-port'" { + description + "Valid only when range-type represented by + trib-port"; + } + type otn-tpn; + description + "Label step which represents possible increments for + Tributary Port Number (TPN)."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of + Evolving G.709 Optical Transport Networks."; + } + } + case trib-slot { + leaf ts { + + + + + when "../../../otn-label-range/range-type = + 'trib-slot'" { + description + "Valid only when range-type represented by + trib-slot"; + } + type otn-ts; + description + "Label step which represents possible increments for + Tributary Slot (TS) number."; + reference + "RFC7139: GMPLS Signaling Extensions for Control of + Evolving G.709 Optical Transport Networks."; + } + } + } + } + } + } diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-network-topology@2018-02-26.yang b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-network-topology@2018-02-26.yang new file mode 100644 index 000000000..0538ac01b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-network-topology@2018-02-26.yang @@ -0,0 +1,294 @@ + module ietf-network-topology { + yang-version 1.1; + namespace "urn:ietf:params:xml:ns:yang:ietf-network-topology"; + prefix nt; + + import ietf-inet-types { + prefix inet; + reference + "RFC 6991: Common YANG Data Types"; + } + import ietf-network { + prefix nw; + reference + "RFC 8345: A YANG Data Model for Network Topologies"; + } + + organization + "IETF I2RS (Interface to the Routing System) Working Group"; + + contact + "WG Web: + WG List: + + Editor: Alexander Clemm + + + Editor: Jan Medved + + + Editor: Robert Varga + + + Editor: Nitin Bahadur + + + Editor: Hariharan Ananthakrishnan + + + Editor: Xufeng Liu + "; + + description + "This module defines a common base model for a network topology, + augmenting the base network data model with links to connect + nodes, as well as termination points to terminate links + on nodes. + + Copyright (c) 2018 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (https://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 8345; + see the RFC itself for full legal notices."; + + revision 2018-02-26 { + description + "Initial revision."; + reference + "RFC 8345: A YANG Data Model for Network Topologies"; + } + + typedef link-id { + type inet:uri; + description + "An identifier for a link in a topology. The precise + structure of the link-id will be up to the implementation. + The identifier SHOULD be chosen such that the same link in a + real network topology will always be identified through the + same identifier, even if the data model is instantiated in + separate datastores. An implementation MAY choose to capture + semantics in the identifier -- for example, to indicate the + type of link and/or the type of topology of which the link is + a part."; + } + + typedef tp-id { + type inet:uri; + description + "An identifier for termination points on a node. The precise + structure of the tp-id will be up to the implementation. + The identifier SHOULD be chosen such that the same termination + point in a real network topology will always be identified + through the same identifier, even if the data model is + instantiated in separate datastores. An implementation MAY + choose to capture semantics in the identifier -- for example, + to indicate the type of termination point and/or the type of + node that contains the termination point."; + } + + grouping link-ref { + description + "This grouping can be used to reference a link in a specific + network. Although it is not used in this module, it is + defined here for the convenience of augmenting modules."; + leaf link-ref { + type leafref { + path "/nw:networks/nw:network[nw:network-id=current()/../"+ + "network-ref]/nt:link/nt:link-id"; + require-instance false; + } + description + "A type for an absolute reference to a link instance. + (This type should not be used for relative references. + In such a case, a relative path should be used instead.)"; + } + uses nw:network-ref; + } + + grouping tp-ref { + description + "This grouping can be used to reference a termination point + in a specific node. Although it is not used in this module, + it is defined here for the convenience of augmenting + modules."; + leaf tp-ref { + type leafref { + path "/nw:networks/nw:network[nw:network-id=current()/../"+ + "network-ref]/nw:node[nw:node-id=current()/../"+ + "node-ref]/nt:termination-point/nt:tp-id"; + require-instance false; + } + description + "A type for an absolute reference to a termination point. + (This type should not be used for relative references. + In such a case, a relative path should be used instead.)"; + } + uses nw:node-ref; + } + + augment "/nw:networks/nw:network" { + description + "Add links to the network data model."; + list link { + key "link-id"; + description + "A network link connects a local (source) node and + a remote (destination) node via a set of the respective + node's termination points. It is possible to have several + links between the same source and destination nodes. + Likewise, a link could potentially be re-homed between + termination points. Therefore, in order to ensure that we + would always know to distinguish between links, every link + is identified by a dedicated link identifier. Note that a + link models a point-to-point link, not a multipoint link."; + leaf link-id { + type link-id; + description + "The identifier of a link in the topology. + A link is specific to a topology to which it belongs."; + } + container source { + description + "This container holds the logical source of a particular + link."; + leaf source-node { + type leafref { + path "../../../nw:node/nw:node-id"; + require-instance false; + } + description + "Source node identifier. Must be in the same topology."; + } + leaf source-tp { + type leafref { + path "../../../nw:node[nw:node-id=current()/../"+ + "source-node]/termination-point/tp-id"; + require-instance false; + } + description + "This termination point is located within the source node + and terminates the link."; + } + } + + container destination { + description + "This container holds the logical destination of a + particular link."; + leaf dest-node { + type leafref { + path "../../../nw:node/nw:node-id"; + require-instance false; + } + description + "Destination node identifier. Must be in the same + network."; + } + leaf dest-tp { + type leafref { + path "../../../nw:node[nw:node-id=current()/../"+ + "dest-node]/termination-point/tp-id"; + require-instance false; + } + description + "This termination point is located within the + destination node and terminates the link."; + } + } + list supporting-link { + key "network-ref link-ref"; + description + "Identifies the link or links on which this link depends."; + leaf network-ref { + type leafref { + path "../../../nw:supporting-network/nw:network-ref"; + require-instance false; + } + description + "This leaf identifies in which underlay topology + the supporting link is present."; + } + + leaf link-ref { + type leafref { + path "/nw:networks/nw:network[nw:network-id=current()/"+ + "../network-ref]/link/link-id"; + require-instance false; + } + description + "This leaf identifies a link that is a part + of this link's underlay. Reference loops in which + a link identifies itself as its underlay, either + directly or transitively, are not allowed."; + } + } + } + } + augment "/nw:networks/nw:network/nw:node" { + description + "Augments termination points that terminate links. + Termination points can ultimately be mapped to interfaces."; + list termination-point { + key "tp-id"; + description + "A termination point can terminate a link. + Depending on the type of topology, a termination point + could, for example, refer to a port or an interface."; + leaf tp-id { + type tp-id; + description + "Termination point identifier."; + } + list supporting-termination-point { + key "network-ref node-ref tp-ref"; + description + "This list identifies any termination points on which a + given termination point depends or onto which it maps. + Those termination points will themselves be contained + in a supporting node. This dependency information can be + inferred from the dependencies between links. Therefore, + this item is not separately configurable. Hence, no + corresponding constraint needs to be articulated. + The corresponding information is simply provided by the + implementing system."; + + leaf network-ref { + type leafref { + path "../../../nw:supporting-node/nw:network-ref"; + require-instance false; + } + description + "This leaf identifies in which topology the + supporting termination point is present."; + } + leaf node-ref { + type leafref { + path "../../../nw:supporting-node/nw:node-ref"; + require-instance false; + } + description + "This leaf identifies in which node the supporting + termination point is present."; + } + leaf tp-ref { + type leafref { + path "/nw:networks/nw:network[nw:network-id=current()/"+ + "../network-ref]/nw:node[nw:node-id=current()/../"+ + "node-ref]/termination-point/tp-id"; + require-instance false; + } + description + "Reference to the underlay node (the underlay node must + be in a different topology)."; + } + } + } + } + } diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-network@2018-02-26.yang b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-network@2018-02-26.yang new file mode 100644 index 000000000..d9da81eee --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-network@2018-02-26.yang @@ -0,0 +1,193 @@ + module ietf-network { + yang-version 1.1; + namespace "urn:ietf:params:xml:ns:yang:ietf-network"; + prefix nw; + + import ietf-inet-types { + prefix inet; + reference + "RFC 6991: Common YANG Data Types"; + } + + organization + "IETF I2RS (Interface to the Routing System) Working Group"; + + contact + "WG Web: + WG List: + + Editor: Alexander Clemm + + + Editor: Jan Medved + + + Editor: Robert Varga + + + Editor: Nitin Bahadur + + + Editor: Hariharan Ananthakrishnan + + + Editor: Xufeng Liu + "; + + description + "This module defines a common base data model for a collection + of nodes in a network. Node definitions are further used + in network topologies and inventories. + + Copyright (c) 2018 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (https://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 8345; + see the RFC itself for full legal notices."; + + revision 2018-02-26 { + description + "Initial revision."; + reference + "RFC 8345: A YANG Data Model for Network Topologies"; + } + + typedef node-id { + type inet:uri; + description + "Identifier for a node. The precise structure of the node-id + will be up to the implementation. For example, some + implementations MAY pick a URI that includes the network-id + as part of the path. The identifier SHOULD be chosen + such that the same node in a real network topology will + always be identified through the same identifier, even if + the data model is instantiated in separate datastores. An + implementation MAY choose to capture semantics in the + identifier -- for example, to indicate the type of node."; + } + + typedef network-id { + type inet:uri; + description + "Identifier for a network. The precise structure of the + network-id will be up to the implementation. The identifier + SHOULD be chosen such that the same network will always be + identified through the same identifier, even if the data model + is instantiated in separate datastores. An implementation MAY + choose to capture semantics in the identifier -- for example, + to indicate the type of network."; + } + + grouping network-ref { + description + "Contains the information necessary to reference a network -- + for example, an underlay network."; + leaf network-ref { + type leafref { + path "/nw:networks/nw:network/nw:network-id"; + require-instance false; + } + description + "Used to reference a network -- for example, an underlay + network."; + } + } + + grouping node-ref { + description + "Contains the information necessary to reference a node."; + leaf node-ref { + type leafref { + path "/nw:networks/nw:network[nw:network-id=current()/../"+ + "network-ref]/nw:node/nw:node-id"; + require-instance false; + } + description + "Used to reference a node. + Nodes are identified relative to the network that + contains them."; + } + uses network-ref; + } + + container networks { + description + "Serves as a top-level container for a list of networks."; + list network { + key "network-id"; + description + "Describes a network. + A network typically contains an inventory of nodes, + topological information (augmented through the + network-topology data model), and layering information."; + leaf network-id { + type network-id; + description + "Identifies a network."; + } + container network-types { + description + "Serves as an augmentation target. + The network type is indicated through corresponding + presence containers augmented into this container."; + } + list supporting-network { + key "network-ref"; + description + "An underlay network, used to represent layered network + topologies."; + leaf network-ref { + type leafref { + path "/nw:networks/nw:network/nw:network-id"; + require-instance false; + } + description + "References the underlay network."; + } + } + + list node { + key "node-id"; + description + "The inventory of nodes of this network."; + leaf node-id { + type node-id; + description + "Uniquely identifies a node within the containing + network."; + } + list supporting-node { + key "network-ref node-ref"; + description + "Represents another node that is in an underlay network + and that supports this node. Used to represent layering + structure."; + leaf network-ref { + type leafref { + path "../../../nw:supporting-network/nw:network-ref"; + require-instance false; + } + description + "References the underlay network of which the + underlay node is a part."; + } + leaf node-ref { + type leafref { + path "/nw:networks/nw:network/nw:node/nw:node-id"; + require-instance false; + } + description + "References the underlay node itself."; + } + } + } + } + } + } diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-otn-topology@2023-07-06.yang b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-otn-topology@2023-07-06.yang new file mode 100644 index 000000000..587612e8e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-otn-topology@2023-07-06.yang @@ -0,0 +1,2405 @@ + module ietf-otn-topology { + yang-version 1.1; + namespace "urn:ietf:params:xml:ns:yang:ietf-otn-topology"; + prefix "otnt"; + + import ietf-network { + prefix "nw"; + reference "RFC 8345: A YANG Data Model for Network Topologies"; + } + + import ietf-network-topology { + prefix "nt"; + reference "RFC 8345: A YANG Data Model for Network Topologies"; + } + + import ietf-te-topology { + prefix "tet"; + reference + "RFC 8795: YANG Data Model for Traffic Engineering + (TE) Topologies"; + } + + import ietf-layer1-types { + prefix "l1-types"; + reference + "I-D.ietf-ccamp-layer1-types: A YANG Data Model + for Layer 1 Types"; + } + + organization + "IETF CCAMP Working Group"; + contact + "WG Web: + WG List: + + Editor: Haomian Zheng + + + Editor: Italo Busi + + + Editor: Xufeng Liu + + + Editor: Sergio Belotti + + + + + + Editor: Oscar Gonzalez de Dios + "; + + description + "This module defines a protocol independent Layer 1/ODU topology + data model. The model fully conforms + to the Network Management Datastore Architecture (NMDA). + + Copyright (c) 2023 IETF Trust and the persons identified + as authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Revised BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (https://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC XXXX; see + the RFC itself for full legal notices. + + The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL + NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED', + 'MAY', and 'OPTIONAL' in this document are to be interpreted as + described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, + they appear in all capitals, as shown here."; + + revision 2023-07-06 { + description + "Initial Revision"; + reference + "RFC XXXX: A YANG Data Model for Optical Transport Network + Topology"; + // RFC Ed.: replace XXXX with actual RFC number, update date + // information and remove this note + } + + /* + * Groupings + */ + + grouping label-range-info { + description + "OTN technology-specific label range related information with + a presence container indicating that the label range is an + OTN technology-specific label range. + + This grouping SHOULD be used together with the + + + + + otn-label-start-end and otn-label-step groupings to provide + OTN technology-specific label information to the models which + use the label-restriction-info grouping defined in the module + ietf-te-types."; + uses l1-types:otn-label-range-info { + refine otn-label-range { + presence + "Indicates the label range is an OTN label range. + + This container MUST NOT be present if there are other + presence containers or attributes indicating another type + of label range."; + } + } + } + + /* + * Data nodes + */ + + augment "/nw:networks/nw:network/nw:network-types/" + + "tet:te-topology" { + container otn-topology { + presence "indicates a topology type of Optical Transport + Network (OTN)-electrical layer."; + description "OTN topology type"; + } + description "augment network types to include OTN newtork"; + } + + augment "/nw:networks/nw:network/nw:node/tet:te" + + "/tet:te-node-attributes" { + when "../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description "Augment only for OTN network."; + } + description "Augment TE node attributes."; + container otn-node { + presence "The TE node is an OTN node."; + description + "Introduce new TE node type for OTN node."; + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:te-link-attributes" { + when "../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + + + + + description "Augment only for OTN network."; + } + description "Augment link configuration"; + + container otn-link { + description + "Attributes of the OTN Link."; + leaf odtu-flex-type { + type l1-types:odtu-flex-type; + description + "The type of Optical Data Tributary Unit (ODTU) + whose nominal bitrate is used to compute the number of + Tributary Slots (TS) required by the ODUflex LSPs set up + on this OTN Link."; + } + leaf tsg { + type identityref { + base l1-types:tributary-slot-granularity; + } + description "Tributary slot granularity."; + reference + "ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN)"; + } + leaf distance { + type uint32; + description "distance in the unit of kilometers"; + } + } + container client-svc { + presence + "When present, indicates that the Link supports Costant + Bit Rate (CBR) client signals."; + description + "Attributes of the Link supporting CBR client signals."; + leaf-list supported-client-signal { + type identityref { + base l1-types:client-signal; + } + min-elements 1; + description + "List of client signal types supported by the Link."; + } + } + } + + augment "/nw:networks/nw:network/nw:node/nt:termination-point/" + + "tet:te" { + + + + + when "../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description "Augment only for OTN network"; + } + description "OTN TP attributes config in ODU topology."; + + container otn-ltp { + description + "Attributes of the OTN Link Termination Point (LTP)."; + leaf odtu-flex-type { + type l1-types:odtu-flex-type; + description + "The type of Optical Data Tributary Unit (ODTU) + whose nominal bitrate is used to compute the number of + Tributary Slots (TS) required by the ODUflex LSPs set up + on this OTN Link Termination Point (LTP)."; + } + } + container client-svc { + presence + "When present, indicates that the Link Termination Point + (LTP) supports Costant Bit Rate (CBR) client signals."; + description + "OTN LTP Service attributes."; + leaf-list supported-client-signal { + type identityref { + base l1-types:client-signal; + } + description + "List of client signal types supported by the LTP."; + } + } + } + + /* + * Augment TE bandwidth + */ + + augment "/nw:networks/nw:network/nw:node/nt:termination-point/" + + "tet:te/" + + "tet:interface-switching-capability/tet:max-lsp-bandwidth/" + + "tet:te-bandwidth/tet:technology" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + + + + + description + "Augment maximum LSP TE bandwidth for the link termination + point (LTP)."; + case otn { + uses l1-types:otn-max-path-bandwidth { + description + "The odtu-flex-type attribute of the OTN Link Termination + Point (LTP) is used to compute the number of Tributary + Slots (TS) required by the ODUflex LSPs set up on this + OTN LTP."; + } + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:path-constraints/tet:te-bandwidth/tet:technology" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE bandwidth path constraints of the TE node + connectivity matrices."; + case otn { + uses l1-types:otn-link-bandwidth { + augment otn { + description + "Augment OTN link bandwidth information."; + leaf odtu-flex-type { + type l1-types:odtu-flex-type; + description + "The type of Optical Data Tributary Unit (ODTU) + whose nominal bitrate is used to compute the number of + Tributary Slots (TS) required by the ODUflex LSPs + set up along the underlay paths of these OTN + connectivity matrices."; + } + } + } + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + + + + + "tet:path-constraints/tet:te-bandwidth/tet:technology" { + when "../../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE bandwidth path constraints of the + connectivity matrix entry."; + case otn { + uses l1-types:otn-link-bandwidth { + augment otn { + description + "Augment OTN link bandwidth information."; + leaf odtu-flex-type { + type l1-types:odtu-flex-type; + description + "The type of Optical Data Tributary Unit (ODTU) + whose nominal bitrate is used to compute the number of + Tributary Slots (TS) required by the ODUflex LSPs + set up along the underlay path of this OTN + connectivity matrix entry."; + } + } + } + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:path-constraints/tet:te-bandwidth/tet:technology" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE bandwidth path constraints of the TE node + connectivity matrices information source."; + case otn { + uses l1-types:otn-link-bandwidth { + augment otn { + description + "Augment OTN link bandwidth information."; + leaf odtu-flex-type { + type l1-types:odtu-flex-type; + + + + + description + "The type of Optical Data Tributary Unit (ODTU) + whose nominal bitrate is used to compute the number of + Tributary Slots (TS) required by the ODUflex LSPs + set up along the underlay paths of these OTN + connectivity matrices."; + } + } + } + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:path-constraints/tet:te-bandwidth/tet:technology" { + when "../../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE bandwidth path constraints of the + connectivity matrix entry information source"; + case otn { + uses l1-types:otn-link-bandwidth { + augment otn { + description + "Augment OTN link bandwidth information."; + leaf odtu-flex-type { + type l1-types:odtu-flex-type; + description + "The type of Optical Data Tributary Unit (ODTU) + whose nominal bitrate is used to compute the number of + Tributary Slots (TS) required by the ODUflex LSPs + set up along the underlay path of this OTN + connectivity matrix entry."; + } + } + } + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:client-layer-adaptation/tet:switching-capability/" + + "tet:te-bandwidth/tet:technology" { + + + + + when "../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment client TE bandwidth of the tunnel termination point + (TTP)"; + case otn { + uses l1-types:otn-link-bandwidth { + augment otn { + description + "Augment OTN link bandwidth information."; + leaf odtu-flex-type { + type l1-types:odtu-flex-type; + description + "The type of Optical Data Tributary Unit (ODTU) + whose nominal bitrate is used to compute the number of + Tributary Slots (TS) required by the ODUflex LSPs + terminated on this OTN Tunnel Termination Point + (TTP)."; + } + } + } + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/tet:path-constraints/" + + "tet:te-bandwidth/tet:technology" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE bandwidth path constraints for the TTP + Local Link Connectivities."; + case otn { + uses l1-types:otn-link-bandwidth { + augment otn { + description + "Augment OTN link bandwidth information."; + leaf odtu-flex-type { + type l1-types:odtu-flex-type; + + + + + description + "The type of Optical Data Tributary Unit (ODTU) + whose nominal bitrate is used to compute the number of + Tributary Slots (TS) required by the ODUflex LSPs + set up along the underlay paths of these OTN Local + Link Connectivities."; + } + } + } + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:local-link-connectivity/tet:path-constraints/" + + "tet:te-bandwidth/tet:technology" { + when "../../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE bandwidth path constraints for the TTP + Local Link Connectivity entry."; + case otn { + uses l1-types:otn-link-bandwidth { + augment otn { + description + "Augment OTN link bandwidth information."; + leaf odtu-flex-type { + type l1-types:odtu-flex-type; + description + "The type of Optical Data Tributary Unit (ODTU) + whose nominal bitrate is used to compute the number of + Tributary Slots (TS) required by the ODUflex LSPs + set up along the underlay path of this OTN Local + Link Connectivyt entry."; + } + } + } + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:te-link-attributes/" + + "tet:interface-switching-capability/tet:max-lsp-bandwidth/" + + + + + + "tet:te-bandwidth/tet:technology" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment maximum LSP TE bandwidth for the TE link."; + case otn { + uses l1-types:otn-max-path-bandwidth { + description + "The odtu-flex-type attribute of the OTN Link is used + to compute the number of Tributary Slots (TS) required + by the ODUflex LSPs set up on this OTN Link."; + } + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:te-link-attributes/" + + "tet:max-link-bandwidth/" + + "tet:te-bandwidth" { + when "../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment maximum TE bandwidth for the TE link"; + uses l1-types:otn-link-bandwidth { + description + "The odtu-flex-type attribute of the OTN Link is used + to compute the number of Tributary Slots (TS) required + by the ODUflex LSPs set up on this OTN Link."; + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:te-link-attributes/" + + "tet:max-resv-link-bandwidth/" + + "tet:te-bandwidth" { + when "../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + + + + + } + description + "Augment maximum reservable TE bandwidth for the TE link"; + uses l1-types:otn-link-bandwidth { + description + "The odtu-flex-type attribute of the OTN Link is used + to compute the number of Tributary Slots (TS) required + by the ODUflex LSPs set up on this OTN Link."; + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:te-link-attributes/" + + "tet:unreserved-bandwidth/" + + "tet:te-bandwidth" { + when "../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment unreserved TE bandwidth for the TE Link"; + uses l1-types:otn-link-bandwidth { + description + "The odtu-flex-type attribute of the OTN Link is used + to compute the number of Tributary Slots (TS) required + by the ODUflex LSPs set up on this OTN Link."; + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:information-source-entry/" + + "tet:interface-switching-capability/" + + "tet:max-lsp-bandwidth/" + + "tet:te-bandwidth/tet:technology" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment maximum LSP TE bandwidth for the TE link + information source"; + case otn { + uses l1-types:otn-max-path-bandwidth { + description + + + + + "The odtu-flex-type attribute of the OTN Link is used + to compute the number of Tributary Slots (TS) required + by the ODUflex LSPs set up on this OTN Link."; + } + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:information-source-entry/" + + "tet:max-link-bandwidth/" + + "tet:te-bandwidth" { + when "../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment maximum TE bandwidth for the TE link + information source"; + uses l1-types:otn-link-bandwidth { + description + "The odtu-flex-type attribute of the OTN Link is used + to compute the number of Tributary Slots (TS) required + by the ODUflex LSPs set up on this OTN Link."; + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:information-source-entry/" + + "tet:max-resv-link-bandwidth/" + + "tet:te-bandwidth" { + when "../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment maximum reservable TE bandwidth for the TE link + information-source"; + uses l1-types:otn-link-bandwidth { + description + "The odtu-flex-type attribute of the OTN Link is used + to compute the number of Tributary Slots (TS) required + by the ODUflex LSPs set up on this OTN Link."; + } + } + + + + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:information-source-entry/" + + "tet:unreserved-bandwidth/" + + "tet:te-bandwidth" { + when "../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment unreserved TE bandwidth of the TE link + information source"; + uses l1-types:otn-link-bandwidth { + description + "The odtu-flex-type attribute of the OTN Link is used + to compute the number of Tributary Slots (TS) required + by the ODUflex LSPs set up on this OTN Link."; + } + } + + augment "/nw:networks/tet:te/tet:templates/" + + "tet:link-template/tet:te-link-attributes/" + + "tet:interface-switching-capability/" + + "tet:max-lsp-bandwidth/" + + "tet:te-bandwidth/tet:technology" { + description + "Augment maximum LSP TE bandwidth of the TE link + template"; + case otn { + uses l1-types:otn-max-path-bandwidth { + description + "The odtu-flex-type attribute of the OTN Link is used + to compute the number of Tributary Slots (TS) required + by the ODUflex LSPs set up on the OTN Link that uses this + Link Template."; + } + } + } + + augment "/nw:networks/tet:te/tet:templates/" + + "tet:link-template/tet:te-link-attributes/" + + "tet:max-link-bandwidth/" + + "tet:te-bandwidth" { + description + "Augment maximum TE bandwidth the TE link template"; + uses l1-types:otn-link-bandwidth { + description + + + + + "The odtu-flex-type attribute of the OTN Link is used + to compute the number of Tributary Slots (TS) required + by the ODUflex LSPs set up on the OTN Link that uses this + Link Template."; + } + } + + augment "/nw:networks/tet:te/tet:templates/" + + "tet:link-template/tet:te-link-attributes/" + + "tet:max-resv-link-bandwidth/" + + "tet:te-bandwidth" { + description + "Augment maximum reservable TE bandwidth for the TE link + template."; + uses l1-types:otn-link-bandwidth { + description + "The odtu-flex-type attribute of the OTN Link is used + to compute the number of Tributary Slots (TS) required + by the ODUflex LSPs set up on the OTN Link that uses this + Link Template."; + } + } + + augment "/nw:networks/tet:te/tet:templates/" + + "tet:link-template/tet:te-link-attributes/" + + "tet:unreserved-bandwidth/" + + "tet:te-bandwidth" { + description + "Augment unreserved TE bandwidth the TE link template"; + uses l1-types:otn-link-bandwidth { + description + "The odtu-flex-type attribute of the OTN Link is used + to compute the number of Tributary Slots (TS) required + by the ODUflex LSPs set up on the OTN Link that uses this + Link Template."; + } + } + + /* + * Augment TE label range information + */ + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:label-restrictions/tet:label-restriction" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + + + + + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range information for the TE node + connectivity matrices."; + uses label-range-info; + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/tet:from/" + + "tet:label-restrictions/tet:label-restriction" { + when "../../../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range information for the source LTP + of the connectivity matrix entry."; + uses label-range-info; + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/tet:to/" + + "tet:label-restrictions/tet:label-restriction" { + when "../../../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range information for the destination LTP + of the connectivity matrix entry."; + uses label-range-info; + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/" + + "tet:connectivity-matrices/tet:label-restrictions/" + + "tet:label-restriction" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + + + + + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range information for the TE node + connectivity matrices information source."; + uses label-range-info; + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:from/tet:label-restrictions/tet:label-restriction" { + when "../../../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range information for the source LTP + of the connectivity matrix entry information source."; + uses label-range-info; + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:to/tet:label-restrictions/tet:label-restriction" { + when "../../../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range information for the destination LTP + of the connectivity matrix entry information source."; + uses label-range-info; + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:label-restrictions/tet:label-restriction" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + + + + + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range information for the TTP + Local Link Connectivities."; + uses label-range-info; + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:local-link-connectivity/" + + "tet:label-restrictions/tet:label-restriction" { + when "../../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range information for the TTP + Local Link Connectivity entry."; + uses label-range-info; + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:te-link-attributes/" + + "tet:label-restrictions/tet:label-restriction" { + when "../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range information for the TE link."; + uses label-range-info; + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:information-source-entry/" + + "tet:label-restrictions/tet:label-restriction" { + when "../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + + + + + } + description + "Augment TE label range information for the TE link + information source."; + uses label-range-info; + } + + augment "/nw:networks/tet:te/tet:templates/" + + "tet:link-template/tet:te-link-attributes/" + + "tet:label-restrictions/tet:label-restriction" { + description + "Augment TE label range information for the TE link template."; + uses label-range-info; + } + + /* + * Augment TE label + */ + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-start/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range start for the TE node + connectivity matrices"; + case otn { + uses l1-types:otn-label-start-end; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:label-restrictions/" + + "tet:label-restriction/tet:label-end/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + + + + + } + description + "Augment TE label range end for the TE node + connectivity matrices"; + case otn { + uses l1-types:otn-label-start-end; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:label-restrictions/" + + "tet:label-restriction/tet:label-step/" + + "tet:technology" { + when "../../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range step for the TE node + connectivity matrices"; + case otn { + uses l1-types:otn-label-step; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:underlay/tet:primary-path/tet:path-element/" + + "tet:type/tet:label/tet:label-hop/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the underlay primary path of the + TE node connectivity matrices"; + case otn { + uses l1-types:otn-label-hop; + } + } + + + + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:underlay/tet:backup-path/tet:path-element/" + + "tet:type/tet:label/tet:label-hop/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the underlay backup path of the + TE node connectivity matrices"; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:optimizations/tet:algorithm/tet:metric/" + + "tet:optimization-metric/" + + "tet:explicit-route-exclude-objects/" + + "tet:route-object-exclude-object/" + + "tet:type/tet:label/tet:label-hop/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the explicit route objects excluded + by the path computation of the TE node connectivity + matrices"; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:optimizations/tet:algorithm/tet:metric/" + + "tet:optimization-metric/" + + + + + + "tet:explicit-route-include-objects/" + + "tet:route-object-include-object/" + + "tet:type/tet:label/tet:label-hop/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the explicit route objects included + by the path computation of the TE node connectivity + matrices"; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:path-properties/tet:path-route-objects/" + + "tet:path-route-object/tet:type/tet:label/tet:label-hop/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the computed path route objects + of the TE node connectivity matrices"; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/tet:from/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-start/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + + + + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range start for the source LTP + of the connectivity matrix entry."; + case otn { + uses l1-types:otn-label-start-end; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/tet:from/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-end/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range end for the source LTP + of the connectivity matrix entry."; + case otn { + uses l1-types:otn-label-start-end; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/tet:from/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-step/" + + "tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + + + + + "Augment TE label range step for the source LTP + of the connectivity matrix entry."; + case otn { + uses l1-types:otn-label-step; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/tet:to/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-start/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range start for the destination LTP + of the connectivity matrix entry."; + case otn { + uses l1-types:otn-label-start-end; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/tet:to/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-end/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range end for the destination LTP + of the connectivity matrix entry."; + case otn { + uses l1-types:otn-label-start-end; + } + } + + + + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/tet:to/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-step/" + + "tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range step for the destination LTP + of the connectivity matrix entry."; + case otn { + uses l1-types:otn-label-step; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:underlay/tet:primary-path/tet:path-element/" + + "tet:type/tet:label/tet:label-hop/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the underlay primary path + of the connectivity matrix entry."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:underlay/tet:backup-path/tet:path-element/" + + "tet:type/tet:label/tet:label-hop/" + + "tet:te-label/tet:technology" { + + + + + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the underlay backup path + of the connectivity matrix entry."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/tet:optimizations/" + + "tet:algorithm/tet:metric/tet:optimization-metric/" + + "tet:explicit-route-exclude-objects/" + + "tet:route-object-exclude-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the explicit route objects excluded + by the path computation of the connectivity matrix entry."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/tet:optimizations/" + + "tet:algorithm/tet:metric/tet:optimization-metric/" + + "tet:explicit-route-include-objects/" + + "tet:route-object-include-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + + + + + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the explicit route objects included + by the path computation of the connectivity matrix entry."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:path-properties/tet:path-route-objects/" + + "tet:path-route-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the computed path route objects + of the connectivity matrix entry."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/" + + "tet:connectivity-matrices/tet:label-restrictions/" + + "tet:label-restriction/" + + "tet:label-start/tet:te-label/tet:technology" { + when "../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range start for the TE node connectivity + matrices information source."; + case otn { + + + + + uses l1-types:otn-label-start-end; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/" + + "tet:connectivity-matrices/tet:label-restrictions/" + + "tet:label-restriction/" + + "tet:label-end/tet:te-label/tet:technology" { + when "../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range end for the TE node connectivity + matrices information source."; + case otn { + uses l1-types:otn-label-start-end; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/" + + "tet:connectivity-matrices/tet:label-restrictions/" + + "tet:label-restriction/" + + "tet:label-step/tet:technology" { + when "../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range step for the TE node connectivity + matrices information source."; + case otn { + uses l1-types:otn-label-step; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:underlay/tet:primary-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + + + + + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the underlay primary path + of the TE node connectivity matrices of the information + source entry."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:underlay/tet:backup-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the underlay backup path + of the TE node connectivity matrices of the information + source entry."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:optimizations/tet:algorithm/tet:metric/" + + "tet:optimization-metric/" + + "tet:explicit-route-exclude-objects/" + + "tet:route-object-exclude-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + + + + + OTN topology type."; + } + description + "Augment TE label hop for the explicit route objects excluded + by the path computation of the TE node connectivity matrices + information source."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:optimizations/tet:algorithm/tet:metric/" + + "tet:optimization-metric/" + + "tet:explicit-route-include-objects/" + + "tet:route-object-include-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the explicit route objects included + by the path computation of the TE node connectivity matrices + information source."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:path-properties/tet:path-route-objects/" + + "tet:path-route-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the computed path route objects + + + + + of the TE node connectivity matrices information source."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:from/tet:label-restrictions/" + + "tet:label-restriction/" + + "tet:label-start/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range start for the source LTP + of the connectivity matrix entry information source."; + case otn { + uses l1-types:otn-label-start-end; + } + } + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:from/tet:label-restrictions/" + + "tet:label-restriction/" + + "tet:label-end/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range end for the source LTP + of the connectivity matrix entry information source."; + case otn { + uses l1-types:otn-label-start-end; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + + + + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:from/tet:label-restrictions/" + + "tet:label-restriction/" + + "tet:label-step/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range step for the source LTP + of the connectivity matrix entry information source."; + case otn { + uses l1-types:otn-label-step; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:to/tet:label-restrictions/tet:label-restriction/" + + "tet:label-start/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range start for the destination LTP + of the connectivity matrix entry information source."; + case otn { + uses l1-types:otn-label-start-end; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:to/tet:label-restrictions/tet:label-restriction/" + + "tet:label-end/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + + + + + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range end for the destination LTP + of the connectivity matrix entry information source."; + case otn { + uses l1-types:otn-label-start-end; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:to/tet:label-restrictions/tet:label-restriction/" + + "tet:label-step/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range step for the destination LTP + of the connectivity matrix entry information source."; + case otn { + uses l1-types:otn-label-step; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:underlay/tet:primary-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the underlay primary path + of the connectivity matrix entry information source."; + case otn { + + + + + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:underlay/tet:backup-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the underlay backup path + of the connectivity matrix entry information source."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:optimizations/tet:algorithm/tet:metric/" + + "tet:optimization-metric/" + + "tet:explicit-route-exclude-objects/" + + "tet:route-object-exclude-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the explicit route objects excluded + by the path computation of the connectivity matrix entry + information source."; + case otn { + uses l1-types:otn-label-hop; + } + } + + + + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:optimizations/tet:algorithm/tet:metric/" + + "tet:optimization-metric/" + + "tet:explicit-route-include-objects/" + + "tet:route-object-include-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the explicit route objects included + by the path computation of the connectivity matrix entry + information source."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:path-properties/tet:path-route-objects/" + + "tet:path-route-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the computed path route objects + of the connectivity matrix entry information source."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + + + + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-start/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range start for the TTP + Local Link Connectivities."; + case otn { + uses l1-types:otn-label-start-end; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-end/" + + "tet:te-label/tet:technology"{ + when "../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range end for the TTP + Local Link Connectivities."; + case otn { + uses l1-types:otn-label-start-end; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-step/" + + "tet:technology"{ + when "../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + + + + + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range step for the TTP + Local Link Connectivities."; + case otn { + uses l1-types:otn-label-step; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:underlay/tet:primary-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the underlay primary path + of the TTP Local Link Connectivities."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:underlay/tet:backup-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the underlay backup path + of the TTP Local Link Connectivities."; + case otn { + + + + + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:optimizations/tet:algorithm/tet:metric/" + + "tet:optimization-metric/" + + "tet:explicit-route-exclude-objects/" + + "tet:route-object-exclude-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the explicit route objects excluded + by the path computation of the TTP Local Link + Connectivities."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:optimizations/tet:algorithm/tet:metric/" + + "tet:optimization-metric/" + + "tet:explicit-route-include-objects/" + + "tet:route-object-include-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the explicit route objects included + by the path computation of the TTP Local Link + Connectivities."; + case otn { + + + + + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:path-properties/tet:path-route-objects/" + + "tet:path-route-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the computed path route objects + of the TTP Local Link Connectivities."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:local-link-connectivity/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-start/tet:te-label/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range start for the TTP + Local Link Connectivity entry."; + case otn { + uses l1-types:otn-label-start-end; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + + + + + "tet:local-link-connectivities/" + + "tet:local-link-connectivity/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-end/tet:te-label/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range end for the TTP + Local Link Connectivity entry."; + case otn { + uses l1-types:otn-label-start-end; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:local-link-connectivity/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-step/tet:technology" { + when "../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range step for the TTP + Local Link Connectivity entry."; + case otn { + uses l1-types:otn-label-step; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:local-link-connectivity/" + + "tet:underlay/tet:primary-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + + + + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the underlay primary path + of the TTP Local Link Connectivity entry."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:local-link-connectivity/" + + "tet:underlay/tet:backup-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the underlay backup path + of the TTP Local Link Connectivity entry."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:local-link-connectivity/" + + "tet:optimizations/tet:algorithm/tet:metric/" + + "tet:optimization-metric/" + + "tet:explicit-route-exclude-objects/" + + "tet:route-object-exclude-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + + + + + OTN topology type."; + } + description + "Augment TE label hop for the explicit route objects excluded + by the path computation of the TTP Local Link + Connectivity entry."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:local-link-connectivity/" + + "tet:optimizations/tet:algorithm/tet:metric/" + + "tet:optimization-metric/" + + "tet:explicit-route-include-objects/" + + "tet:route-object-include-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the explicit route objects included + by the path computation of the TTP Local Link + Connectivity entry."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:local-link-connectivity/" + + "tet:path-properties/tet:path-route-objects/" + + "tet:path-route-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + + + + + OTN topology type."; + } + description + "Augment TE label hop for the computed path route objects + of the TTP Local Link Connectivity entry."; + case otn { + uses l1-types:otn-label-hop; + } + } + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:te-link-attributes/" + + "tet:underlay/tet:primary-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the underlay primary path + of the TE link."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:te-link-attributes/" + + "tet:underlay/tet:backup-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label hop for the underlay backup path + of the TE link."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + + + + + "tet:te-link-attributes/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-start/tet:te-label/tet:technology" { + when "../../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range start for the TE link."; + case otn { + uses l1-types:otn-label-start-end; + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:te-link-attributes/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-end/tet:te-label/tet:technology" { + when "../../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range end for the TE link."; + case otn { + uses l1-types:otn-label-start-end; + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:te-link-attributes/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-step/tet:technology" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range step for the TE link."; + case otn { + uses l1-types:otn-label-step; + } + + + + + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:information-source-entry/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-start/tet:te-label/tet:technology" { + when "../../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range start for the TE link + information source."; + case otn { + uses l1-types:otn-label-start-end; + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:information-source-entry/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-end/tet:te-label/tet:technology" { + when "../../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + description + "Augment TE label range end for the TE link + information source."; + case otn { + uses l1-types:otn-label-start-end; + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:information-source-entry/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-step/tet:technology" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "otnt:otn-topology" { + description + "Augmentation parameters apply only for networks with + OTN topology type."; + } + + + + + description + "Augment TE label range step for the TE link + information source."; + case otn { + uses l1-types:otn-label-step; + } + } + + augment "/nw:networks/tet:te/tet:templates/" + + "tet:link-template/tet:te-link-attributes/" + + "tet:underlay/tet:primary-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + description + "Augment TE label hop for the underlay primary path + of the TE link template."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/tet:te/tet:templates/" + + "tet:link-template/tet:te-link-attributes/" + + "tet:underlay/tet:backup-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + description + "Augment TE label hop for the underlay backup path + of the TE link template."; + case otn { + uses l1-types:otn-label-hop; + } + } + + augment "/nw:networks/tet:te/tet:templates/" + + "tet:link-template/tet:te-link-attributes/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-start/tet:te-label/tet:technology" { + description + "Augment TE label range start for the TE link template."; + case otn { + uses l1-types:otn-label-start-end; + } + } + + augment "/nw:networks/tet:te/tet:templates/" + + "tet:link-template/tet:te-link-attributes/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-end/tet:te-label/tet:technology" { + description + + + + + "Augment TE label range end for the TE link template."; + case otn { + uses l1-types:otn-label-start-end; + } + } + + augment "/nw:networks/tet:te/tet:templates/" + + "tet:link-template/tet:te-link-attributes/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-step/tet:technology" { + description + "Augment TE label range step for the TE link template."; + case otn { + uses l1-types:otn-label-step; + } + } + } diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-routing-types@2017-12-04.yang b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-routing-types@2017-12-04.yang new file mode 100644 index 000000000..695d9eaeb --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-routing-types@2017-12-04.yang @@ -0,0 +1,774 @@ + module ietf-routing-types { + namespace "urn:ietf:params:xml:ns:yang:ietf-routing-types"; + prefix rt-types; + + import ietf-yang-types { + prefix yang; + } + import ietf-inet-types { + prefix inet; + } + + organization + "IETF RTGWG - Routing Area Working Group"; + contact + "WG Web: + WG List: + + Editors: Xufeng Liu + + Yingzhen Qu + + Acee Lindem + + Christian Hopps + + Lou Berger + "; + + description + "This module contains a collection of YANG data types + considered generally useful for routing protocols. + + Copyright (c) 2017 IETF Trust and the persons + identified as authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (https://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 8294; see + the RFC itself for full legal notices."; + + revision 2017-12-04 { + description "Initial revision."; + reference + "RFC 8294: Common YANG Data Types for the Routing Area. + Section 3."; + } + + /*** Identities related to MPLS/GMPLS ***/ + + identity mpls-label-special-purpose-value { + description + "Base identity for deriving identities describing + special-purpose Multiprotocol Label Switching (MPLS) label + values."; + reference + "RFC 7274: Allocating and Retiring Special-Purpose MPLS + Labels."; + } + + identity ipv4-explicit-null-label { + base mpls-label-special-purpose-value; + description + "This identity represents the IPv4 Explicit NULL Label."; + reference + "RFC 3032: MPLS Label Stack Encoding. Section 2.1."; + } + + identity router-alert-label { + base mpls-label-special-purpose-value; + description + "This identity represents the Router Alert Label."; + reference + "RFC 3032: MPLS Label Stack Encoding. Section 2.1."; + } + + identity ipv6-explicit-null-label { + base mpls-label-special-purpose-value; + description + "This identity represents the IPv6 Explicit NULL Label."; + reference + "RFC 3032: MPLS Label Stack Encoding. Section 2.1."; + } + + identity implicit-null-label { + base mpls-label-special-purpose-value; + description + "This identity represents the Implicit NULL Label."; + reference + "RFC 3032: MPLS Label Stack Encoding. Section 2.1."; + } + + identity entropy-label-indicator { + base mpls-label-special-purpose-value; + description + "This identity represents the Entropy Label Indicator."; + reference + "RFC 6790: The Use of Entropy Labels in MPLS Forwarding. + Sections 3 and 10.1."; + } + + identity gal-label { + base mpls-label-special-purpose-value; + description + "This identity represents the Generic Associated Channel + (G-ACh) Label (GAL)."; + reference + "RFC 5586: MPLS Generic Associated Channel. + Sections 4 and 10."; + } + + identity oam-alert-label { + base mpls-label-special-purpose-value; + description + "This identity represents the OAM Alert Label."; + reference + "RFC 3429: Assignment of the 'OAM Alert Label' for + Multiprotocol Label Switching Architecture (MPLS) + Operation and Maintenance (OAM) Functions. + Sections 3 and 6."; + } + + identity extension-label { + base mpls-label-special-purpose-value; + description + "This identity represents the Extension Label."; + reference + "RFC 7274: Allocating and Retiring Special-Purpose MPLS + Labels. Sections 3.1 and 5."; + } + + /*** Collection of types related to routing ***/ + + typedef router-id { + type yang:dotted-quad; + description + "A 32-bit number in the dotted-quad format assigned to each + router. This number uniquely identifies the router within + an Autonomous System."; + } + + /*** Collection of types related to VPNs ***/ + + typedef route-target { + type string { + pattern + '(0:(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|' + + '6[0-4][0-9]{3}|' + + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0):(429496729[0-5]|' + + '42949672[0-8][0-9]|' + + '4294967[01][0-9]{2}|429496[0-6][0-9]{3}|' + + '42949[0-5][0-9]{4}|' + + '4294[0-8][0-9]{5}|429[0-3][0-9]{6}|' + + '42[0-8][0-9]{7}|4[01][0-9]{8}|' + + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0))|' + + '(1:((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|' + + '25[0-5])\.){3}([0-9]|[1-9][0-9]|' + + '1[0-9]{2}|2[0-4][0-9]|25[0-5])):(6553[0-5]|' + + '655[0-2][0-9]|' + + '65[0-4][0-9]{2}|6[0-4][0-9]{3}|' + + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|' + + '(2:(429496729[0-5]|42949672[0-8][0-9]|' + + '4294967[01][0-9]{2}|' + + '429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|' + + '4294[0-8][0-9]{5}|' + + '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[01][0-9]{8}|' + + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0):' + + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|' + + '6[0-4][0-9]{3}|' + + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|' + + '(6(:[a-fA-F0-9]{2}){6})|' + + '(([3-57-9a-fA-F]|[1-9a-fA-F][0-9a-fA-F]{1,3}):' + + '[0-9a-fA-F]{1,12})'; + } + + description + "A Route Target is an 8-octet BGP extended community + initially identifying a set of sites in a BGP VPN + (RFC 4364). However, it has since taken on a more general + role in BGP route filtering. A Route Target consists of two + or three fields: a 2-octet Type field, an administrator + field, and, optionally, an assigned number field. + + According to the data formats for types 0, 1, 2, and 6 as + defined in RFC 4360, RFC 5668, and RFC 7432, the encoding + pattern is defined as: + + 0:2-octet-asn:4-octet-number + 1:4-octet-ipv4addr:2-octet-number + 2:4-octet-asn:2-octet-number + 6:6-octet-mac-address + + Additionally, a generic pattern is defined for future + Route Target types: + + 2-octet-other-hex-number:6-octet-hex-number + + Some valid examples are 0:100:100, 1:1.1.1.1:100, + 2:1234567890:203, and 6:26:00:08:92:78:00."; + reference + "RFC 4360: BGP Extended Communities Attribute. + RFC 4364: BGP/MPLS IP Virtual Private Networks (VPNs). + RFC 5668: 4-Octet AS Specific BGP Extended Community. + RFC 7432: BGP MPLS-Based Ethernet VPN."; + } + + typedef ipv6-route-target { + type string { + pattern + '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}' + + '((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|' + + '(((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\.){3}' + + '(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])))' + + ':' + + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|' + + '6[0-4][0-9]{3}|' + + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0)'; + pattern '((([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|' + + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))' + + ':' + + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|' + + '6[0-4][0-9]{3}|' + + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0)'; + } + description + "An IPv6 Route Target is a 20-octet BGP IPv6 Address + Specific Extended Community serving the same function + as a standard 8-octet Route Target, except that it only + allows an IPv6 address as the global administrator. + The format is . + + Two valid examples are 2001:db8::1:6544 and + 2001:db8::5eb1:791:6b37:17958."; + reference + "RFC 5701: IPv6 Address Specific BGP Extended Community + Attribute."; + } + + typedef route-target-type { + type enumeration { + enum import { + value 0; + description + "The Route Target applies to route import."; + } + enum export { + value 1; + description + "The Route Target applies to route export."; + } + + enum both { + value 2; + description + "The Route Target applies to both route import and + route export."; + } + } + description + "Indicates the role a Route Target takes in route filtering."; + reference + "RFC 4364: BGP/MPLS IP Virtual Private Networks (VPNs)."; + } + + typedef route-distinguisher { + type string { + pattern + '(0:(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|' + + '6[0-4][0-9]{3}|' + + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0):(429496729[0-5]|' + + '42949672[0-8][0-9]|' + + '4294967[01][0-9]{2}|429496[0-6][0-9]{3}|' + + '42949[0-5][0-9]{4}|' + + '4294[0-8][0-9]{5}|429[0-3][0-9]{6}|' + + '42[0-8][0-9]{7}|4[01][0-9]{8}|' + + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0))|' + + '(1:((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|' + + '25[0-5])\.){3}([0-9]|[1-9][0-9]|' + + '1[0-9]{2}|2[0-4][0-9]|25[0-5])):(6553[0-5]|' + + '655[0-2][0-9]|' + + '65[0-4][0-9]{2}|6[0-4][0-9]{3}|' + + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|' + + '(2:(429496729[0-5]|42949672[0-8][0-9]|' + + '4294967[01][0-9]{2}|' + + '429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|' + + '4294[0-8][0-9]{5}|' + + '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[01][0-9]{8}|' + + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0):' + + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|' + + '6[0-4][0-9]{3}|' + + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|' + + '(6(:[a-fA-F0-9]{2}){6})|' + + '(([3-57-9a-fA-F]|[1-9a-fA-F][0-9a-fA-F]{1,3}):' + + '[0-9a-fA-F]{1,12})'; + } + + description + "A Route Distinguisher is an 8-octet value used to + distinguish routes from different BGP VPNs (RFC 4364). + A Route Distinguisher will have the same format as a + Route Target as per RFC 4360 and will consist of + two or three fields: a 2-octet Type field, an administrator + field, and, optionally, an assigned number field. + + According to the data formats for types 0, 1, 2, and 6 as + defined in RFC 4360, RFC 5668, and RFC 7432, the encoding + pattern is defined as: + + 0:2-octet-asn:4-octet-number + 1:4-octet-ipv4addr:2-octet-number + 2:4-octet-asn:2-octet-number + 6:6-octet-mac-address + + Additionally, a generic pattern is defined for future + route discriminator types: + + 2-octet-other-hex-number:6-octet-hex-number + + Some valid examples are 0:100:100, 1:1.1.1.1:100, + 2:1234567890:203, and 6:26:00:08:92:78:00."; + reference + "RFC 4360: BGP Extended Communities Attribute. + RFC 4364: BGP/MPLS IP Virtual Private Networks (VPNs). + RFC 5668: 4-Octet AS Specific BGP Extended Community. + RFC 7432: BGP MPLS-Based Ethernet VPN."; + } + + typedef route-origin { + type string { + pattern + '(0:(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|' + + '6[0-4][0-9]{3}|' + + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0):(429496729[0-5]|' + + '42949672[0-8][0-9]|' + + '4294967[01][0-9]{2}|429496[0-6][0-9]{3}|' + + '42949[0-5][0-9]{4}|' + + '4294[0-8][0-9]{5}|429[0-3][0-9]{6}|' + + '42[0-8][0-9]{7}|4[01][0-9]{8}|' + + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0))|' + + '(1:((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|' + + '25[0-5])\.){3}([0-9]|[1-9][0-9]|' + + '1[0-9]{2}|2[0-4][0-9]|25[0-5])):(6553[0-5]|' + + '655[0-2][0-9]|' + + '65[0-4][0-9]{2}|6[0-4][0-9]{3}|' + + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|' + + '(2:(429496729[0-5]|42949672[0-8][0-9]|' + + '4294967[01][0-9]{2}|' + + '429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|' + + '4294[0-8][0-9]{5}|' + + '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[01][0-9]{8}|' + + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0):' + + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|' + + '6[0-4][0-9]{3}|' + + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|' + + '(6(:[a-fA-F0-9]{2}){6})|' + + '(([3-57-9a-fA-F]|[1-9a-fA-F][0-9a-fA-F]{1,3}):' + + '[0-9a-fA-F]{1,12})'; + } + description + "A Route Origin is an 8-octet BGP extended community + identifying the set of sites where the BGP route + originated (RFC 4364). A Route Origin will have the same + format as a Route Target as per RFC 4360 and will consist + of two or three fields: a 2-octet Type field, an + administrator field, and, optionally, an assigned number + field. + + According to the data formats for types 0, 1, 2, and 6 as + defined in RFC 4360, RFC 5668, and RFC 7432, the encoding + pattern is defined as: + + 0:2-octet-asn:4-octet-number + 1:4-octet-ipv4addr:2-octet-number + 2:4-octet-asn:2-octet-number + 6:6-octet-mac-address + + Additionally, a generic pattern is defined for future + Route Origin types: + + 2-octet-other-hex-number:6-octet-hex-number + + Some valid examples are 0:100:100, 1:1.1.1.1:100, + 2:1234567890:203, and 6:26:00:08:92:78:00."; + reference + "RFC 4360: BGP Extended Communities Attribute. + RFC 4364: BGP/MPLS IP Virtual Private Networks (VPNs). + RFC 5668: 4-Octet AS Specific BGP Extended Community. + RFC 7432: BGP MPLS-Based Ethernet VPN."; + } + + typedef ipv6-route-origin { + type string { + pattern + '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}' + + '((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|' + + '(((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\.){3}' + + '(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])))' + + ':' + + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|' + + '6[0-4][0-9]{3}|' + + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0)'; + pattern '((([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|' + + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))' + + ':' + + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|' + + '6[0-4][0-9]{3}|' + + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0)'; + } + description + "An IPv6 Route Origin is a 20-octet BGP IPv6 Address + Specific Extended Community serving the same function + as a standard 8-octet route, except that it only allows + an IPv6 address as the global administrator. The format + is . + + Two valid examples are 2001:db8::1:6544 and + 2001:db8::5eb1:791:6b37:17958."; + reference + "RFC 5701: IPv6 Address Specific BGP Extended Community + Attribute."; + } + + /*** Collection of types common to multicast ***/ + + typedef ipv4-multicast-group-address { + type inet:ipv4-address { + pattern '(2((2[4-9])|(3[0-9]))\.).*'; + } + description + "This type represents an IPv4 multicast group address, + which is in the range of 224.0.0.0 to 239.255.255.255."; + reference + "RFC 1112: Host Extensions for IP Multicasting."; + } + + typedef ipv6-multicast-group-address { + type inet:ipv6-address { + pattern '(([fF]{2}[0-9a-fA-F]{2}):).*'; + } + description + "This type represents an IPv6 multicast group address, + which is in the range of ff00::/8."; + reference + "RFC 4291: IP Version 6 Addressing Architecture. Section 2.7. + RFC 7346: IPv6 Multicast Address Scopes."; + } + + typedef ip-multicast-group-address { + type union { + type ipv4-multicast-group-address; + type ipv6-multicast-group-address; + } + description + "This type represents a version-neutral IP multicast group + address. The format of the textual representation implies + the IP version."; + } + + typedef ipv4-multicast-source-address { + type union { + type enumeration { + enum * { + description + "Any source address."; + } + } + type inet:ipv4-address; + } + description + "Multicast source IPv4 address type."; + } + + typedef ipv6-multicast-source-address { + type union { + type enumeration { + enum * { + description + "Any source address."; + } + } + type inet:ipv6-address; + } + description + "Multicast source IPv6 address type."; + } + + /*** Collection of types common to protocols ***/ + + typedef bandwidth-ieee-float32 { + type string { + pattern + '0[xX](0((\.0?)?[pP](\+)?0?|(\.0?))|' + + '1(\.([0-9a-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\+)?(12[0-7]|' + + '1[01][0-9]|0?[0-9]?[0-9])?)'; + } + description + "Bandwidth in IEEE 754 floating-point 32-bit binary format: + (-1)**(S) * 2**(Exponent-127) * (1 + Fraction), + where Exponent uses 8 bits and Fraction uses 23 bits. + The units are octets per second. + The encoding format is the external hexadecimal-significant + character sequences specified in IEEE 754 and ISO/IEC C99. + The format is restricted to be normalized, non-negative, and + non-fraction: 0x1.hhhhhhp{+}d, 0X1.HHHHHHP{+}D, or 0x0p0, + where 'h' and 'H' are hexadecimal digits and 'd' and 'D' are + integers in the range of [0..127]. + + When six hexadecimal digits are used for 'hhhhhh' or + 'HHHHHH', the least significant digit must be an even + number. 'x' and 'X' indicate hexadecimal; 'p' and 'P' + indicate a power of two. Some examples are 0x0p0, 0x1p10, + and 0x1.abcde2p+20."; + reference + "IEEE Std 754-2008: IEEE Standard for Floating-Point + Arithmetic. + ISO/IEC C99: Information technology - Programming + Languages - C."; + } + + typedef link-access-type { + type enumeration { + enum broadcast { + description + "Specify broadcast multi-access network."; + } + enum non-broadcast-multiaccess { + description + "Specify Non-Broadcast Multi-Access (NBMA) network."; + } + enum point-to-multipoint { + description + "Specify point-to-multipoint network."; + } + enum point-to-point { + description + "Specify point-to-point network."; + } + } + description + "Link access type."; + } + + typedef timer-multiplier { + type uint8; + description + "The number of timer value intervals that should be + interpreted as a failure."; + } + + typedef timer-value-seconds16 { + type union { + type uint16 { + range "1..65535"; + } + type enumeration { + enum infinity { + description + "The timer is set to infinity."; + } + enum not-set { + description + "The timer is not set."; + } + } + } + units "seconds"; + description + "Timer value type, in seconds (16-bit range)."; + } + + typedef timer-value-seconds32 { + type union { + type uint32 { + range "1..4294967295"; + } + type enumeration { + enum infinity { + description + "The timer is set to infinity."; + } + enum not-set { + description + "The timer is not set."; + } + } + } + units "seconds"; + description + "Timer value type, in seconds (32-bit range)."; + } + + typedef timer-value-milliseconds { + type union { + type uint32 { + range "1..4294967295"; + } + type enumeration { + enum infinity { + description + "The timer is set to infinity."; + } + enum not-set { + description + "The timer is not set."; + } + } + } + units "milliseconds"; + description + "Timer value type, in milliseconds."; + } + + typedef percentage { + type uint8 { + range "0..100"; + } + description + "Integer indicating a percentage value."; + } + + typedef timeticks64 { + type uint64; + description + "This type is based on the timeticks type defined in + RFC 6991, but with 64-bit width. It represents the time, + modulo 2^64, in hundredths of a second between two epochs."; + reference + "RFC 6991: Common YANG Data Types."; + } + + typedef uint24 { + type uint32 { + range "0..16777215"; + } + description + "24-bit unsigned integer."; + } + + /*** Collection of types related to MPLS/GMPLS ***/ + + typedef generalized-label { + type binary; + description + "Generalized Label. Nodes sending and receiving the + Generalized Label are aware of the link-specific + label context and type."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description. Section 3.2."; + } + + typedef mpls-label-special-purpose { + type identityref { + base mpls-label-special-purpose-value; + } + description + "This type represents the special-purpose MPLS label values."; + reference + "RFC 3032: MPLS Label Stack Encoding. + RFC 7274: Allocating and Retiring Special-Purpose MPLS + Labels."; + } + + typedef mpls-label-general-use { + type uint32 { + range "16..1048575"; + } + description + "The 20-bit label value in an MPLS label stack as specified + in RFC 3032. This label value does not include the + encodings of Traffic Class and TTL (Time to Live). + The label range specified by this type is for general use, + with special-purpose MPLS label values excluded."; + reference + "RFC 3032: MPLS Label Stack Encoding."; + } + + typedef mpls-label { + type union { + type mpls-label-special-purpose; + type mpls-label-general-use; + } + description + "The 20-bit label value in an MPLS label stack as specified + in RFC 3032. This label value does not include the + encodings of Traffic Class and TTL."; + reference + "RFC 3032: MPLS Label Stack Encoding."; + } + + /*** Groupings **/ + + grouping mpls-label-stack { + description + "This grouping specifies an MPLS label stack. The label + stack is encoded as a list of label stack entries. The + list key is an identifier that indicates the relative + ordering of each entry, with the lowest-value identifier + corresponding to the top of the label stack."; + container mpls-label-stack { + description + "Container for a list of MPLS label stack entries."; + list entry { + key "id"; + description + "List of MPLS label stack entries."; + leaf id { + type uint8; + description + "Identifies the entry in a sequence of MPLS label + stack entries. An entry with a smaller identifier + value precedes an entry with a larger identifier + value in the label stack. The value of this ID has + no semantic meaning other than relative ordering + and referencing the entry."; + } + leaf label { + type rt-types:mpls-label; + description + "Label value."; + } + + leaf ttl { + type uint8; + description + "Time to Live (TTL)."; + reference + "RFC 3032: MPLS Label Stack Encoding."; + } + leaf traffic-class { + type uint8 { + range "0..7"; + } + description + "Traffic Class (TC)."; + reference + "RFC 5462: Multiprotocol Label Switching (MPLS) Label + Stack Entry: 'EXP' Field Renamed to 'Traffic Class' + Field."; + } + } + } + } + + grouping vpn-route-targets { + description + "A grouping that specifies Route Target import-export rules + used in BGP-enabled VPNs."; + reference + "RFC 4364: BGP/MPLS IP Virtual Private Networks (VPNs). + RFC 4664: Framework for Layer 2 Virtual Private Networks + (L2VPNs)."; + list vpn-target { + key "route-target"; + description + "List of Route Targets."; + leaf route-target { + type rt-types:route-target; + description + "Route Target value."; + } + leaf route-target-type { + type rt-types:route-target-type; + mandatory true; + description + "Import/export type of the Route Target."; + } + } + } + } diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-te-packet-types@2020-06-10.yang b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-te-packet-types@2020-06-10.yang new file mode 100644 index 000000000..8e7d4aafa --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-te-packet-types@2020-06-10.yang @@ -0,0 +1,475 @@ +module ietf-te-packet-types { + yang-version 1.1; + namespace "urn:ietf:params:xml:ns:yang:ietf-te-packet-types"; + prefix te-packet-types; + + /* Import TE generic types */ + + import ietf-te-types { + prefix te-types; + reference + "RFC 8776: Common YANG Data Types for Traffic Engineering"; + } + + organization + "IETF Traffic Engineering Architecture and Signaling (TEAS) + Working Group"; + contact + "WG Web: + WG List: + + Editor: Tarek Saad + + + Editor: Rakesh Gandhi + + + Editor: Vishnu Pavan Beeram + + + Editor: Xufeng Liu + + + Editor: Igor Bryskin + "; + description + "This YANG module contains a collection of generally useful YANG + data type definitions specific to MPLS TE. The model fully + conforms to the Network Management Datastore Architecture + (NMDA). + + Copyright (c) 2020 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject to + the license terms contained in, the Simplified BSD License set + forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (https://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 8776; see the + RFC itself for full legal notices."; + + revision 2020-06-10 { + description + "Latest revision of TE MPLS types."; + reference + "RFC 8776: Common YANG Data Types for Traffic Engineering"; + } + + /** + * Typedefs + */ + + typedef te-bandwidth-requested-type { + type enumeration { + enum specified { + description + "Bandwidth is explicitly specified."; + } + enum auto { + description + "Bandwidth is automatically computed."; + } + } + description + "Enumerated type for specifying whether bandwidth is + explicitly specified or automatically computed."; + } + + typedef te-class-type { + type uint8; + description + "Diffserv-TE Class-Type. Defines a set of Traffic Trunks + crossing a link that is governed by a specific set of + bandwidth constraints. Class-Type is used for the purposes + of link bandwidth allocation, constraint-based routing, and + admission control."; + reference + "RFC 4124: Protocol Extensions for Support of Diffserv-aware + MPLS Traffic Engineering"; + } + + typedef bc-type { + type uint8 { + range "0..7"; + } + description + "Diffserv-TE bandwidth constraints as defined in RFC 4124."; + reference + "RFC 4124: Protocol Extensions for Support of Diffserv-aware + MPLS Traffic Engineering"; + } + + typedef bandwidth-kbps { + type uint64; + units "Kbps"; + description + "Bandwidth values, expressed in kilobits per second."; + } + + typedef bandwidth-mbps { + type uint64; + units "Mbps"; + description + "Bandwidth values, expressed in megabits per second."; + } + + typedef bandwidth-gbps { + type uint64; + units "Gbps"; + description + "Bandwidth values, expressed in gigabits per second."; + } + + identity backup-protection-type { + description + "Base identity for the backup protection type."; + } + + identity backup-protection-link { + base backup-protection-type; + description + "Backup provides link protection only."; + } + + identity backup-protection-node-link { + base backup-protection-type; + description + "Backup offers node (preferred) or link protection."; + } + + identity bc-model-type { + description + "Base identity for the Diffserv-TE Bandwidth Constraints + Model type."; + reference + "RFC 4124: Protocol Extensions for Support of Diffserv-aware + MPLS Traffic Engineering"; + } + + identity bc-model-rdm { + base bc-model-type; + description + "Russian Dolls Bandwidth Constraints Model type."; + reference + "RFC 4127: Russian Dolls Bandwidth Constraints Model for + Diffserv-aware MPLS Traffic Engineering"; + } + + identity bc-model-mam { + base bc-model-type; + description + "Maximum Allocation Bandwidth Constraints Model type."; + reference + "RFC 4125: Maximum Allocation Bandwidth Constraints Model for + Diffserv-aware MPLS Traffic Engineering"; + } + + identity bc-model-mar { + base bc-model-type; + description + "Maximum Allocation with Reservation Bandwidth Constraints + Model type."; + reference + "RFC 4126: Max Allocation with Reservation Bandwidth + Constraints Model for Diffserv-aware MPLS Traffic Engineering + & Performance Comparisons"; + } + + grouping performance-metrics-attributes-packet { + description + "Contains PM attributes."; + uses te-types:performance-metrics-attributes { + augment "performance-metrics-one-way" { + leaf one-way-min-delay { + type uint32 { + range "0..16777215"; + } + description + "One-way minimum delay or latency in microseconds."; + } + leaf one-way-min-delay-normality { + type te-types:performance-metrics-normality; + default "normal"; + description + "One-way minimum delay or latency normality."; + } + leaf one-way-max-delay { + type uint32 { + range "0..16777215"; + } + description + "One-way maximum delay or latency in microseconds."; + } + leaf one-way-max-delay-normality { + type te-types:performance-metrics-normality; + default "normal"; + description + "One-way maximum delay or latency normality."; + } + leaf one-way-delay-variation { + type uint32 { + range "0..16777215"; + } + description + "One-way delay variation in microseconds."; + reference + "RFC 5481: Packet Delay Variation Applicability + Statement, Section 4.2"; + } + leaf one-way-delay-variation-normality { + type te-types:performance-metrics-normality; + default "normal"; + description + "One-way delay variation normality."; + reference + "RFC 7471: OSPF Traffic Engineering (TE) Metric + Extensions + RFC 7823: Performance-Based Path Selection for + Explicitly Routed Label Switched Paths (LSPs) Using + TE Metric Extensions + RFC 8570: IS-IS Traffic Engineering (TE) Metric + Extensions"; + } + leaf one-way-packet-loss { + type decimal64 { + fraction-digits 6; + range "0..50.331642"; + } + description + "One-way packet loss as a percentage of the total traffic + sent over a configurable interval. The finest precision + is 0.000003%, where the maximum is 50.331642%."; + reference + "RFC 8570: IS-IS Traffic Engineering (TE) Metric + Extensions, Section 4.4"; + } + leaf one-way-packet-loss-normality { + type te-types:performance-metrics-normality; + default "normal"; + description + "Packet loss normality."; + reference + "RFC 7471: OSPF Traffic Engineering (TE) Metric + Extensions + RFC 7823: Performance-Based Path Selection for + Explicitly Routed Label Switched Paths (LSPs) Using + TE Metric Extensions + RFC 8570: IS-IS Traffic Engineering (TE) Metric + Extensions"; + } + description + "PM one-way packet-specific augmentation for a generic PM + grouping."; + } + augment "performance-metrics-two-way" { + leaf two-way-min-delay { + type uint32 { + range "0..16777215"; + } + default "0"; + description + "Two-way minimum delay or latency in microseconds."; + } + leaf two-way-min-delay-normality { + type te-types:performance-metrics-normality; + default "normal"; + description + "Two-way minimum delay or latency normality."; + reference + "RFC 7471: OSPF Traffic Engineering (TE) Metric + Extensions + RFC 7823: Performance-Based Path Selection for + Explicitly Routed Label Switched Paths (LSPs) Using + TE Metric Extensions + RFC 8570: IS-IS Traffic Engineering (TE) Metric + Extensions"; + } + leaf two-way-max-delay { + type uint32 { + range "0..16777215"; + } + default "0"; + description + "Two-way maximum delay or latency in microseconds."; + } + leaf two-way-max-delay-normality { + type te-types:performance-metrics-normality; + default "normal"; + description + "Two-way maximum delay or latency normality."; + reference + "RFC 7471: OSPF Traffic Engineering (TE) Metric + Extensions + RFC 7823: Performance-Based Path Selection for + Explicitly Routed Label Switched Paths (LSPs) Using + TE Metric Extensions + RFC 8570: IS-IS Traffic Engineering (TE) Metric + Extensions"; + } + leaf two-way-delay-variation { + type uint32 { + range "0..16777215"; + } + default "0"; + description + "Two-way delay variation in microseconds."; + reference + "RFC 5481: Packet Delay Variation Applicability + Statement, Section 4.2"; + } + leaf two-way-delay-variation-normality { + type te-types:performance-metrics-normality; + default "normal"; + description + "Two-way delay variation normality."; + reference + "RFC 7471: OSPF Traffic Engineering (TE) Metric + Extensions + RFC 7823: Performance-Based Path Selection for + Explicitly Routed Label Switched Paths (LSPs) Using + TE Metric Extensions + RFC 8570: IS-IS Traffic Engineering (TE) Metric + Extensions"; + } + leaf two-way-packet-loss { + type decimal64 { + fraction-digits 6; + range "0..50.331642"; + } + default "0"; + description + "Two-way packet loss as a percentage of the total traffic + sent over a configurable interval. The finest precision + is 0.000003%."; + } + leaf two-way-packet-loss-normality { + type te-types:performance-metrics-normality; + default "normal"; + description + "Two-way packet loss normality."; + } + description + "PM two-way packet-specific augmentation for a generic PM + grouping."; + reference + "RFC 7471: OSPF Traffic Engineering (TE) Metric Extensions + RFC 7823: Performance-Based Path Selection for + Explicitly Routed Label Switched Paths (LSPs) Using + TE Metric Extensions + RFC 8570: IS-IS Traffic Engineering (TE) Metric + Extensions"; + } + } + } + + grouping one-way-performance-metrics-packet { + description + "One-way packet PM throttle grouping."; + leaf one-way-min-delay { + type uint32 { + range "0..16777215"; + } + default "0"; + description + "One-way minimum delay or latency in microseconds."; + } + leaf one-way-max-delay { + type uint32 { + range "0..16777215"; + } + default "0"; + description + "One-way maximum delay or latency in microseconds."; + } + leaf one-way-delay-variation { + type uint32 { + range "0..16777215"; + } + default "0"; + description + "One-way delay variation in microseconds."; + } + leaf one-way-packet-loss { + type decimal64 { + fraction-digits 6; + range "0..50.331642"; + } + default "0"; + description + "One-way packet loss as a percentage of the total traffic + sent over a configurable interval. The finest precision is + 0.000003%."; + } + } + + grouping two-way-performance-metrics-packet { + description + "Two-way packet PM throttle grouping."; + leaf two-way-min-delay { + type uint32 { + range "0..16777215"; + } + default "0"; + description + "Two-way minimum delay or latency in microseconds."; + } + leaf two-way-max-delay { + type uint32 { + range "0..16777215"; + } + default "0"; + description + "Two-way maximum delay or latency in microseconds."; + } + leaf two-way-delay-variation { + type uint32 { + range "0..16777215"; + } + default "0"; + description + "Two-way delay variation in microseconds."; + } + leaf two-way-packet-loss { + type decimal64 { + fraction-digits 6; + range "0..50.331642"; + } + default "0"; + description + "Two-way packet loss as a percentage of the total traffic + sent over a configurable interval. The finest precision is + 0.000003%."; + } + } + + grouping performance-metrics-throttle-container-packet { + description + "Packet PM threshold grouping."; + uses te-types:performance-metrics-throttle-container { + augment "throttle/threshold-out" { + uses one-way-performance-metrics-packet; + uses two-way-performance-metrics-packet; + description + "PM threshold-out packet augmentation for a + generic grouping."; + } + augment "throttle/threshold-in" { + uses one-way-performance-metrics-packet; + uses two-way-performance-metrics-packet; + description + "PM threshold-in packet augmentation for a + generic grouping."; + } + augment "throttle/threshold-accelerated-advertisement" { + uses one-way-performance-metrics-packet; + uses two-way-performance-metrics-packet; + description + "PM accelerated advertisement packet augmentation for a + generic grouping."; + } + } + } +} diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-te-topology@2020-08-06.yang b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-te-topology@2020-08-06.yang new file mode 100644 index 000000000..6d76a77b2 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-te-topology@2020-08-06.yang @@ -0,0 +1,1952 @@ +module ietf-te-topology { + yang-version 1.1; + namespace "urn:ietf:params:xml:ns:yang:ietf-te-topology"; + prefix tet; + + import ietf-yang-types { + prefix yang; + reference + "RFC 6991: Common YANG Data Types"; + } + import ietf-inet-types { + prefix inet; + reference + "RFC 6991: Common YANG Data Types"; + } + import ietf-te-types { + prefix te-types; + reference + "RFC 8776: Common YANG Data Types for Traffic Engineering"; + } + import ietf-network { + prefix nw; + reference + "RFC 8345: A YANG Data Model for Network Topologies"; + } + import ietf-network-topology { + prefix nt; + reference + "RFC 8345: A YANG Data Model for Network Topologies"; + } + + organization + "IETF Traffic Engineering Architecture and Signaling (TEAS) + Working Group"; + contact + "WG Web: + WG List: + + Editor: Xufeng Liu + + + Editor: Igor Bryskin + + + Editor: Vishnu Pavan Beeram + + + Editor: Tarek Saad + + + Editor: Himanshu Shah + + + Editor: Oscar Gonzalez de Dios + "; + description + "This YANG module defines a TE topology model for representing, + retrieving, and manipulating technology-agnostic TE topologies. + + Copyright (c) 2020 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject to + the license terms contained in, the Simplified BSD License set + forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (https://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 8795; see the + RFC itself for full legal notices."; + + revision 2020-08-06 { + description + "Initial revision."; + reference + "RFC 8795: YANG Data Model for Traffic Engineering (TE) + Topologies"; + } + + /* + * Features + */ + + feature nsrlg { + description + "This feature indicates that the system supports NSRLGs + (Non-Shared Risk Link Groups)."; + } + + feature te-topology-hierarchy { + description + "This feature indicates that the system allows an underlay + and/or overlay TE topology hierarchy."; + } + + feature template { + description + "This feature indicates that the system supports + template configuration."; + } + + /* + * Typedefs + */ + + typedef geographic-coordinate-degree { + type decimal64 { + fraction-digits 8; + } + description + "Decimal degree (DD) used to express latitude and longitude + geographic coordinates."; + } + // geographic-coordinate-degree + + typedef te-info-source { + type enumeration { + enum unknown { + description + "The source is unknown."; + } + enum locally-configured { + description + "Configured entity."; + } + enum ospfv2 { + description + "OSPFv2."; + } + enum ospfv3 { + description + "OSPFv3."; + } + enum isis { + description + "IS-IS."; + } + enum bgp-ls { + description + "BGP-LS."; + reference + "RFC 7752: North-Bound Distribution of Link-State and + Traffic Engineering (TE) Information Using BGP"; + } + enum system-processed { + description + "System-processed entity."; + } + enum other { + description + "Other source."; + } + } + description + "Describes the type of source that has provided the + related information, and the source's credibility."; + } + // te-info-source + + /* + * Groupings + */ + + grouping connectivity-matrix-entry-path-attributes { + description + "Attributes of a connectivity matrix entry."; + leaf is-allowed { + type boolean; + description + "'true' - switching is allowed; + 'false' - switching is disallowed."; + } + container underlay { + if-feature "te-topology-hierarchy"; + description + "Attributes of the TE link underlay."; + reference + "RFC 4206: Label Switched Paths (LSP) Hierarchy with + Generalized Multi-Protocol Label Switching (GMPLS) + Traffic Engineering (TE)"; + uses te-link-underlay-attributes; + } + uses te-types:generic-path-constraints; + uses te-types:generic-path-optimization; + uses te-types:generic-path-properties; + } + // connectivity-matrix-entry-path-attributes + + grouping geolocation-container { + description + "Contains a GPS location."; + container geolocation { + config false; + description + "Contains a GPS location."; + leaf altitude { + type int64; + units "millimeters"; + description + "Distance above sea level."; + } + leaf latitude { + type geographic-coordinate-degree { + range "-90..90"; + } + description + "Relative position north or south on the Earth's surface."; + } + leaf longitude { + type geographic-coordinate-degree { + range "-180..180"; + } + description + "Angular distance east or west on the Earth's surface."; + } + } + // geolocation + } + // geolocation-container + + grouping information-source-state-attributes { + description + "The attributes identifying the source that has provided the + related information, and the source's credibility."; + leaf credibility-preference { + type uint16; + description + "The preference value for calculating the Traffic + Engineering database credibility value used for + tie-break selection between different information-source + values. A higher value is preferable."; + } + leaf logical-network-element { + type string; + description + "When applicable, this is the name of a logical network + element from which the information is learned."; + } + leaf network-instance { + type string; + description + "When applicable, this is the name of a network instance + from which the information is learned."; + } + } + // information-source-state-attributes + + grouping information-source-per-link-attributes { + description + "Per-node container of the attributes identifying the source + that has provided the related information, and the source's + credibility."; + leaf information-source { + type te-info-source; + config false; + description + "Indicates the type of information source."; + } + leaf information-source-instance { + type string; + config false; + description + "The name indicating the instance of the information + source."; + } + container information-source-state { + config false; + description + "Contains state attributes related to the information + source."; + uses information-source-state-attributes; + container topology { + description + "When the information is processed by the system, + the attributes in this container indicate which topology + is used to generate the result information."; + uses nt:link-ref; + } + } + } + // information-source-per-link-attributes + + grouping information-source-per-node-attributes { + description + "Per-node container of the attributes identifying the source + that has provided the related information, and the source's + credibility."; + leaf information-source { + type te-info-source; + config false; + description + "Indicates the type of information source."; + } + leaf information-source-instance { + type string; + config false; + description + "The name indicating the instance of the information + source."; + } + container information-source-state { + config false; + description + "Contains state attributes related to the information + source."; + uses information-source-state-attributes; + container topology { + description + "When the information is processed by the system, + the attributes in this container indicate which topology + is used to generate the result information."; + uses nw:node-ref; + } + } + } + // information-source-per-node-attributes + + grouping interface-switching-capability-list { + description + "List of Interface Switching Capability Descriptors (ISCDs)."; + list interface-switching-capability { + key "switching-capability encoding"; + description + "List of ISCDs for this link."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description + RFC 4203: OSPF Extensions in Support of Generalized + Multi-Protocol Label Switching (GMPLS)"; + leaf switching-capability { + type identityref { + base te-types:switching-capabilities; + } + description + "Switching capability for this interface."; + } + leaf encoding { + type identityref { + base te-types:lsp-encoding-types; + } + description + "Encoding supported by this interface."; + } + uses te-link-iscd-attributes; + } + // interface-switching-capability + } + // interface-switching-capability-list + + grouping statistics-per-link { + description + "Statistics attributes per TE link."; + leaf discontinuity-time { + type yang:date-and-time; + description + "The time of the most recent occasion at which any one or + more of this interface's counters suffered a + discontinuity. If no such discontinuities have occurred + since the last re-initialization of the local management + subsystem, then this node contains the time the local + management subsystem re-initialized itself."; + } + /* Administrative attributes */ + leaf disables { + type yang:counter32; + description + "Number of times that a link was disabled."; + } + leaf enables { + type yang:counter32; + description + "Number of times that a link was enabled."; + } + leaf maintenance-clears { + type yang:counter32; + description + "Number of times that a link was taken out of maintenance."; + } + leaf maintenance-sets { + type yang:counter32; + description + "Number of times that a link was put in maintenance."; + } + leaf modifies { + type yang:counter32; + description + "Number of times that a link was modified."; + } + /* Operational attributes */ + leaf downs { + type yang:counter32; + description + "Number of times that a link was set to an operational state + of 'down'."; + } + leaf ups { + type yang:counter32; + description + "Number of times that a link was set to an operational state + of 'up'."; + } + /* Recovery attributes */ + leaf fault-clears { + type yang:counter32; + description + "Number of times that a link experienced a fault-clear + event."; + } + leaf fault-detects { + type yang:counter32; + description + "Number of times that a link experienced fault detection."; + } + leaf protection-switches { + type yang:counter32; + description + "Number of times that a link experienced protection + switchover."; + } + leaf protection-reverts { + type yang:counter32; + description + "Number of times that a link experienced protection + reversion."; + } + leaf restoration-failures { + type yang:counter32; + description + "Number of times that a link experienced restoration + failure."; + } + leaf restoration-starts { + type yang:counter32; + description + "Number of times that a link experienced restoration + start."; + } + leaf restoration-successes { + type yang:counter32; + description + "Number of times that a link experienced restoration + success."; + } + leaf restoration-reversion-failures { + type yang:counter32; + description + "Number of times that a link experienced restoration + reversion failure."; + } + leaf restoration-reversion-starts { + type yang:counter32; + description + "Number of times that a link experienced restoration + reversion start."; + } + leaf restoration-reversion-successes { + type yang:counter32; + description + "Number of times that a link experienced restoration + reversion success."; + } + } + // statistics-per-link + + grouping statistics-per-node { + description + "Statistics attributes per TE node."; + leaf discontinuity-time { + type yang:date-and-time; + description + "The time of the most recent occasion at which any one or + more of this interface's counters suffered a + discontinuity. If no such discontinuities have occurred + since the last re-initialization of the local management + subsystem, then this node contains the time the local + management subsystem re-initialized itself."; + } + container node { + description + "Contains statistics attributes at the TE node level."; + leaf disables { + type yang:counter32; + description + "Number of times that a node was disabled."; + } + leaf enables { + type yang:counter32; + description + "Number of times that a node was enabled."; + } + leaf maintenance-sets { + type yang:counter32; + description + "Number of times that a node was put in maintenance."; + } + leaf maintenance-clears { + type yang:counter32; + description + "Number of times that a node was taken out of + maintenance."; + } + leaf modifies { + type yang:counter32; + description + "Number of times that a node was modified."; + } + } + // node + container connectivity-matrix-entry { + description + "Contains statistics attributes at the level of a + connectivity matrix entry."; + leaf creates { + type yang:counter32; + description + "Number of times that a connectivity matrix entry was + created."; + reference + "RFC 6241: Network Configuration Protocol (NETCONF), + Section 7.2, 'create' operation"; + } + leaf deletes { + type yang:counter32; + description + "Number of times that a connectivity matrix entry was + deleted."; + reference + "RFC 6241: Network Configuration Protocol (NETCONF), + Section 7.2, 'delete' operation"; + } + leaf disables { + type yang:counter32; + description + "Number of times that a connectivity matrix entry was + disabled."; + } + leaf enables { + type yang:counter32; + description + "Number of times that a connectivity matrix entry was + enabled."; + } + leaf modifies { + type yang:counter32; + description + "Number of times that a connectivity matrix entry was + modified."; + } + } + // connectivity-matrix-entry + } + // statistics-per-node + + grouping statistics-per-ttp { + description + "Statistics attributes per TE TTP (Tunnel Termination Point)."; + leaf discontinuity-time { + type yang:date-and-time; + description + "The time of the most recent occasion at which any one or + more of this interface's counters suffered a + discontinuity. If no such discontinuities have occurred + since the last re-initialization of the local management + subsystem, then this node contains the time the local + management subsystem re-initialized itself."; + } + container tunnel-termination-point { + description + "Contains statistics attributes at the TE TTP level."; + /* Administrative attributes */ + leaf disables { + type yang:counter32; + description + "Number of times that a TTP was disabled."; + } + leaf enables { + type yang:counter32; + description + "Number of times that a TTP was enabled."; + } + leaf maintenance-clears { + type yang:counter32; + description + "Number of times that a TTP was taken out of maintenance."; + } + leaf maintenance-sets { + type yang:counter32; + description + "Number of times that a TTP was put in maintenance."; + } + leaf modifies { + type yang:counter32; + description + "Number of times that a TTP was modified."; + } + /* Operational attributes */ + leaf downs { + type yang:counter32; + description + "Number of times that a TTP was set to an operational state + of 'down'."; + } + leaf ups { + type yang:counter32; + description + "Number of times that a TTP was set to an operational state + of 'up'."; + } + leaf in-service-clears { + type yang:counter32; + description + "Number of times that a TTP was taken out of service + (TE tunnel was released)."; + } + leaf in-service-sets { + type yang:counter32; + description + "Number of times that a TTP was put in service by a TE + tunnel (TE tunnel was set up)."; + } + } + // tunnel-termination-point + container local-link-connectivity { + description + "Contains statistics attributes at the TE LLCL (Local Link + Connectivity List) level."; + leaf creates { + type yang:counter32; + description + "Number of times that an LLCL entry was created."; + reference + "RFC 6241: Network Configuration Protocol (NETCONF), + Section 7.2, 'create' operation"; + } + leaf deletes { + type yang:counter32; + description + "Number of times that an LLCL entry was deleted."; + reference + "RFC 6241: Network Configuration Protocol (NETCONF), + Section 7.2, 'delete' operation"; + } + leaf disables { + type yang:counter32; + description + "Number of times that an LLCL entry was disabled."; + } + leaf enables { + type yang:counter32; + description + "Number of times that an LLCL entry was enabled."; + } + leaf modifies { + type yang:counter32; + description + "Number of times that an LLCL entry was modified."; + } + } + // local-link-connectivity + } + // statistics-per-ttp + + grouping te-link-augment { + description + "Augmentation for a TE link."; + uses te-link-config; + uses te-link-state-derived; + container statistics { + config false; + description + "Statistics data."; + uses statistics-per-link; + } + } + // te-link-augment + + grouping te-link-config { + description + "TE link configuration grouping."; + choice bundle-stack-level { + description + "The TE link can be partitioned into bundled links or + component links."; + case bundle { + container bundled-links { + description + "A set of bundled links."; + reference + "RFC 4201: Link Bundling in MPLS Traffic + Engineering (TE)"; + list bundled-link { + key "sequence"; + description + "Specifies a bundled interface that is + further partitioned."; + leaf sequence { + type uint32; + description + "Identifies the sequence in the bundle."; + } + } + } + } + case component { + container component-links { + description + "A set of component links."; + list component-link { + key "sequence"; + description + "Specifies a component interface that is + sufficient to unambiguously identify the + appropriate resources."; + leaf sequence { + type uint32; + description + "Identifies the sequence in the bundle."; + } + leaf src-interface-ref { + type string; + description + "Reference to a component link interface on the + source node."; + } + leaf des-interface-ref { + type string; + description + "Reference to a component link interface on the + destination node."; + } + } + } + } + } + // bundle-stack-level + leaf-list te-link-template { + if-feature "template"; + type leafref { + path "../../../../te/templates/link-template/name"; + } + description + "The reference to a TE link template."; + } + uses te-link-config-attributes; + } + // te-link-config + + grouping te-link-config-attributes { + description + "Link configuration attributes in a TE topology."; + container te-link-attributes { + description + "Link attributes in a TE topology."; + leaf access-type { + type te-types:te-link-access-type; + description + "Link access type, which can be point-to-point or + multi-access."; + } + container external-domain { + description + "For an inter-domain link, specifies the attributes of + the remote end of the link, to facilitate the signaling at + the local end."; + uses nw:network-ref; + leaf remote-te-node-id { + type te-types:te-node-id; + description + "Remote TE node identifier, used together with + 'remote-te-link-tp-id' to identify the remote Link + Termination Point (LTP) in a different domain."; + } + leaf remote-te-link-tp-id { + type te-types:te-tp-id; + description + "Remote TE LTP identifier, used together with + 'remote-te-node-id' to identify the remote LTP in a + different domain."; + } + } + leaf is-abstract { + type empty; + description + "Present if the link is abstract."; + } + leaf name { + type string; + description + "Link name."; + } + container underlay { + if-feature "te-topology-hierarchy"; + description + "Attributes of the TE link underlay."; + reference + "RFC 4206: Label Switched Paths (LSP) Hierarchy with + Generalized Multi-Protocol Label Switching (GMPLS) + Traffic Engineering (TE)"; + uses te-link-underlay-attributes; + } + leaf admin-status { + type te-types:te-admin-status; + description + "The administrative state of the link."; + } + uses te-link-info-attributes; + } + // te-link-attributes + } + // te-link-config-attributes + + grouping te-link-info-attributes { + description + "Advertised TE information attributes."; + leaf link-index { + type uint64; + description + "The link identifier. If OSPF is used, this object + represents an ospfLsdbID. If IS-IS is used, this object + represents an isisLSPID. If a locally configured link is + used, this object represents a unique value, which is + locally defined in a router."; + } + leaf administrative-group { + type te-types:admin-groups; + description + "Administrative group or color of the link. + This attribute covers both administrative groups (defined + in RFCs 3630 and 5305) and Extended Administrative Groups + (defined in RFC 7308)."; + reference + "RFC 3630: Traffic Engineering (TE) Extensions to OSPF + Version 2 + RFC 5305: IS-IS Extensions for Traffic Engineering + RFC 7308: Extended Administrative Groups in MPLS Traffic + Engineering (MPLS-TE)"; + } + uses interface-switching-capability-list; + uses te-types:label-set-info; + leaf link-protection-type { + type identityref { + base te-types:link-protection-type; + } + description + "Link Protection Type desired for this link."; + reference + "RFC 4202: Routing Extensions in Support of + Generalized Multi-Protocol Label Switching (GMPLS)"; + } + container max-link-bandwidth { + uses te-types:te-bandwidth; + description + "Maximum bandwidth that can be seen on this link in this + direction. Units are in bytes per second."; + reference + "RFC 3630: Traffic Engineering (TE) Extensions to OSPF + Version 2 + RFC 5305: IS-IS Extensions for Traffic Engineering"; + } + container max-resv-link-bandwidth { + uses te-types:te-bandwidth; + description + "Maximum amount of bandwidth that can be reserved in this + direction in this link. Units are in bytes per second."; + reference + "RFC 3630: Traffic Engineering (TE) Extensions to OSPF + Version 2 + RFC 5305: IS-IS Extensions for Traffic Engineering"; + } + list unreserved-bandwidth { + key "priority"; + max-elements 8; + description + "Unreserved bandwidth for priority levels 0-7. Units are in + bytes per second."; + reference + "RFC 3630: Traffic Engineering (TE) Extensions to OSPF + Version 2 + RFC 5305: IS-IS Extensions for Traffic Engineering"; + leaf priority { + type uint8 { + range "0..7"; + } + description + "Priority."; + } + uses te-types:te-bandwidth; + } + leaf te-default-metric { + type uint32; + description + "Traffic Engineering metric."; + reference + "RFC 3630: Traffic Engineering (TE) Extensions to OSPF + Version 2 + RFC 5305: IS-IS Extensions for Traffic Engineering"; + } + leaf te-delay-metric { + type uint32; + description + "Traffic Engineering delay metric."; + reference + "RFC 7471: OSPF Traffic Engineering (TE) Metric Extensions"; + } + leaf te-igp-metric { + type uint32; + description + "IGP metric used for Traffic Engineering."; + reference + "RFC 3785: Use of Interior Gateway Protocol (IGP) Metric as a + second MPLS Traffic Engineering (TE) Metric"; + } + container te-srlgs { + description + "Contains a list of SRLGs."; + leaf-list value { + type te-types:srlg; + description + "SRLG value."; + reference + "RFC 4202: Routing Extensions in Support of + Generalized Multi-Protocol Label Switching (GMPLS)"; + } + } + container te-nsrlgs { + if-feature "nsrlg"; + description + "Contains a list of NSRLGs (Non-Shared Risk Link Groups). + When an abstract TE link is configured, this list specifies + the request that underlay TE paths need to be mutually + disjoint with other TE links in the same groups."; + leaf-list id { + type uint32; + description + "NSRLG ID, uniquely configured within a topology."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) + Recovery"; + } + } + } + // te-link-info-attributes + + grouping te-link-iscd-attributes { + description + "TE link ISCD attributes."; + reference + "RFC 4203: OSPF Extensions in Support of Generalized + Multi-Protocol Label Switching (GMPLS), Section 1.4"; + list max-lsp-bandwidth { + key "priority"; + max-elements 8; + description + "Maximum Label Switched Path (LSP) bandwidth at + priorities 0-7."; + leaf priority { + type uint8 { + range "0..7"; + } + description + "Priority."; + } + uses te-types:te-bandwidth; + } + } + // te-link-iscd-attributes + + grouping te-link-state-derived { + description + "Link state attributes in a TE topology."; + leaf oper-status { + type te-types:te-oper-status; + config false; + description + "The current operational state of the link."; + } + leaf is-transitional { + type empty; + config false; + description + "Present if the link is transitional; used as an + alternative approach in lieu of 'inter-layer-lock-id' + for path computation in a TE topology covering multiple + layers or multiple regions."; + reference + "RFC 5212: Requirements for GMPLS-Based Multi-Region and + Multi-Layer Networks (MRN/MLN) + RFC 6001: Generalized MPLS (GMPLS) Protocol Extensions + for Multi-Layer and Multi-Region Networks (MLN/MRN)"; + } + uses information-source-per-link-attributes; + list information-source-entry { + key "information-source information-source-instance"; + config false; + description + "A list of information sources learned, including the source + that is used."; + uses information-source-per-link-attributes; + uses te-link-info-attributes; + } + container recovery { + config false; + description + "Status of the recovery process."; + leaf restoration-status { + type te-types:te-recovery-status; + description + "Restoration status."; + } + leaf protection-status { + type te-types:te-recovery-status; + description + "Protection status."; + } + } + container underlay { + if-feature "te-topology-hierarchy"; + config false; + description + "State attributes for the TE link underlay."; + leaf dynamic { + type boolean; + description + "'true' if the underlay is dynamically created."; + } + leaf committed { + type boolean; + description + "'true' if the underlay is committed."; + } + } + } + // te-link-state-derived + + grouping te-link-underlay-attributes { + description + "Attributes for the TE link underlay."; + reference + "RFC 4206: Label Switched Paths (LSP) Hierarchy with + Generalized Multi-Protocol Label Switching (GMPLS) + Traffic Engineering (TE)"; + leaf enabled { + type boolean; + description + "'true' if the underlay is enabled. + 'false' if the underlay is disabled."; + } + container primary-path { + description + "The service path on the underlay topology that + supports this link."; + uses nw:network-ref; + list path-element { + key "path-element-id"; + description + "A list of path elements describing the service path."; + leaf path-element-id { + type uint32; + description + "To identify the element in a path."; + } + uses te-path-element; + } + } + // primary-path + list backup-path { + key "index"; + description + "A list of backup service paths on the underlay topology that + protect the underlay primary path. If the primary path is + not protected, the list contains zero elements. If the + primary path is protected, the list contains one or more + elements."; + leaf index { + type uint32; + description + "A sequence number to identify a backup path."; + } + uses nw:network-ref; + list path-element { + key "path-element-id"; + description + "A list of path elements describing the backup service + path."; + leaf path-element-id { + type uint32; + description + "To identify the element in a path."; + } + uses te-path-element; + } + } + // backup-path + leaf protection-type { + type identityref { + base te-types:lsp-protection-type; + } + description + "Underlay protection type desired for this link."; + } + container tunnel-termination-points { + description + "Underlay TTPs desired for this link."; + leaf source { + type binary; + description + "Source TTP identifier."; + } + leaf destination { + type binary; + description + "Destination TTP identifier."; + } + } + container tunnels { + description + "Underlay TE tunnels supporting this TE link."; + leaf sharing { + type boolean; + default "true"; + description + "'true' if the underlay tunnel can be shared with other + TE links; + 'false' if the underlay tunnel is dedicated to this + TE link. + This leaf is the default option for all TE tunnels + and may be overridden by the per-TE-tunnel value."; + } + list tunnel { + key "tunnel-name"; + description + "Zero, one, or more underlay TE tunnels that support this + TE link."; + leaf tunnel-name { + type string; + description + "A tunnel name uniquely identifies an underlay TE tunnel, + used together with the 'source-node' value for this + link."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels"; + } + leaf sharing { + type boolean; + description + "'true' if the underlay tunnel can be shared with other + TE links; + 'false' if the underlay tunnel is dedicated to this + TE link."; + } + } + // tunnel + } + // tunnels + } + // te-link-underlay-attributes + + grouping te-node-augment { + description + "Augmentation for a TE node."; + uses te-node-config; + uses te-node-state-derived; + container statistics { + config false; + description + "Statistics data."; + uses statistics-per-node; + } + list tunnel-termination-point { + key "tunnel-tp-id"; + description + "A termination point can terminate a tunnel."; + leaf tunnel-tp-id { + type binary; + description + "TTP identifier."; + } + uses te-node-tunnel-termination-point-config; + leaf oper-status { + type te-types:te-oper-status; + config false; + description + "The current operational state of the TTP."; + } + uses geolocation-container; + container statistics { + config false; + description + "Statistics data."; + uses statistics-per-ttp; + } + // Relationship to other TTPs + list supporting-tunnel-termination-point { + key "node-ref tunnel-tp-ref"; + description + "Identifies the TTPs on which this TTP depends."; + leaf node-ref { + type inet:uri; + description + "This leaf identifies the node in which the supporting + TTP is present. + This node is either the supporting node or a node in + an underlay topology."; + } + leaf tunnel-tp-ref { + type binary; + description + "Reference to a TTP that is in either the supporting node + or a node in an underlay topology."; + } + } + // supporting-tunnel-termination-point + } + // tunnel-termination-point + } + // te-node-augment + + grouping te-node-config { + description + "TE node configuration grouping."; + leaf-list te-node-template { + if-feature "template"; + type leafref { + path "../../../../te/templates/node-template/name"; + } + description + "The reference to a TE node template."; + } + uses te-node-config-attributes; + } + // te-node-config + + grouping te-node-config-attributes { + description + "Configuration node attributes in a TE topology."; + container te-node-attributes { + description + "Contains node attributes in a TE topology."; + leaf admin-status { + type te-types:te-admin-status; + description + "The administrative state of the link."; + } + uses te-node-connectivity-matrices; + uses te-node-info-attributes; + } + } + // te-node-config-attributes + + grouping te-node-config-attributes-template { + description + "Configuration node attributes for a template in a TE + topology."; + container te-node-attributes { + description + "Contains node attributes in a TE topology."; + leaf admin-status { + type te-types:te-admin-status; + description + "The administrative state of the link."; + } + uses te-node-info-attributes; + } + } + // te-node-config-attributes-template + + grouping te-node-connectivity-matrices { + description + "Connectivity matrix on a TE node."; + container connectivity-matrices { + description + "Contains a connectivity matrix on a TE node."; + leaf number-of-entries { + type uint16; + description + "The number of connectivity matrix entries. + If this number is specified in the configuration request, + the number is the requested number of entries, which may + not all be listed in the list; + if this number is reported in the state data, + the number is the current number of operational entries."; + } + uses te-types:label-set-info; + uses connectivity-matrix-entry-path-attributes; + list connectivity-matrix { + key "id"; + description + "Represents a node's switching limitations, i.e., + limitations in the interconnecting network TE links + across the node."; + reference + "RFC 7579: General Network Element Constraint Encoding + for GMPLS-Controlled Networks"; + leaf id { + type uint32; + description + "Identifies the connectivity matrix entry."; + } + } + // connectivity-matrix + } + // connectivity-matrices + } + // te-node-connectivity-matrices + + grouping te-node-connectivity-matrix-attributes { + description + "Termination point references of a connectivity matrix entry."; + container from { + description + "Reference to a source LTP."; + leaf tp-ref { + type leafref { + path "../../../../../../nt:termination-point/nt:tp-id"; + } + description + "Relative reference to a termination point."; + } + uses te-types:label-set-info; + } + container to { + description + "Reference to a destination LTP."; + leaf tp-ref { + type leafref { + path "../../../../../../nt:termination-point/nt:tp-id"; + } + description + "Relative reference to a termination point."; + } + uses te-types:label-set-info; + } + uses connectivity-matrix-entry-path-attributes; + } + // te-node-connectivity-matrix-attributes + + grouping te-node-info-attributes { + description + "Advertised TE information attributes."; + leaf domain-id { + type uint32; + description + "Identifies the domain to which this node belongs. + This attribute is used to support inter-domain links."; + reference + "RFC 5152: A Per-Domain Path Computation Method for + Establishing Inter-Domain Traffic Engineering (TE) + Label Switched Paths (LSPs) + RFC 5316: ISIS Extensions in Support of Inter-Autonomous + System (AS) MPLS and GMPLS Traffic Engineering + RFC 5392: OSPF Extensions in Support of Inter-Autonomous + System (AS) MPLS and GMPLS Traffic Engineering"; + } + leaf is-abstract { + type empty; + description + "Present if the node is abstract; not present if the node + is actual."; + } + leaf name { + type string; + description + "Node name."; + } + leaf-list signaling-address { + type inet:ip-address; + description + "The node's signaling address."; + } + container underlay-topology { + if-feature "te-topology-hierarchy"; + description + "When an abstract node encapsulates a topology, the + attributes in this container point to said topology."; + uses nw:network-ref; + } + } + // te-node-info-attributes + + grouping te-node-state-derived { + description + "Node state attributes in a TE topology."; + leaf oper-status { + type te-types:te-oper-status; + config false; + description + "The current operational state of the node."; + } + uses geolocation-container; + leaf is-multi-access-dr { + type empty; + config false; + description + "The presence of this attribute indicates that this TE node + is a pseudonode elected as a designated router."; + reference + "RFC 1195: Use of OSI IS-IS for Routing in TCP/IP and Dual + Environments + RFC 3630: Traffic Engineering (TE) Extensions to OSPF + Version 2"; + } + uses information-source-per-node-attributes; + list information-source-entry { + key "information-source information-source-instance"; + config false; + description + "A list of information sources learned, including the source + that is used."; + uses information-source-per-node-attributes; + uses te-node-connectivity-matrices; + uses te-node-info-attributes; + } + } + // te-node-state-derived + + grouping te-node-tunnel-termination-point-config { + description + "Termination capability of a TTP on a TE node."; + uses te-node-tunnel-termination-point-config-attributes; + container local-link-connectivities { + description + "Contains an LLCL for a TTP on a TE node."; + leaf number-of-entries { + type uint16; + description + "The number of LLCL entries. + If this number is specified in the configuration request, + the number is the requested number of entries, which may + not all be listed in the list; + if this number is reported in the state data, + the number is the current number of operational entries."; + } + uses te-types:label-set-info; + uses connectivity-matrix-entry-path-attributes; + } + } + // te-node-tunnel-termination-point-config + + grouping te-node-tunnel-termination-point-config-attributes { + description + "Configuration attributes of a TTP on a TE node."; + leaf admin-status { + type te-types:te-admin-status; + description + "The administrative state of the TTP."; + } + leaf name { + type string; + description + "A descriptive name for the TTP."; + } + leaf switching-capability { + type identityref { + base te-types:switching-capabilities; + } + description + "Switching capability for this interface."; + } + leaf encoding { + type identityref { + base te-types:lsp-encoding-types; + } + description + "Encoding supported by this interface."; + } + leaf-list inter-layer-lock-id { + type uint32; + description + "Inter-layer lock ID, used for path computation in a TE + topology covering multiple layers or multiple regions."; + reference + "RFC 5212: Requirements for GMPLS-Based Multi-Region and + Multi-Layer Networks (MRN/MLN) + RFC 6001: Generalized MPLS (GMPLS) Protocol Extensions + for Multi-Layer and Multi-Region Networks (MLN/MRN)"; + } + leaf protection-type { + type identityref { + base te-types:lsp-protection-type; + } + description + "The protection type that this TTP is capable of."; + } + container client-layer-adaptation { + description + "Contains capability information to support a client-layer + adaptation in a multi-layer topology."; + list switching-capability { + key "switching-capability encoding"; + description + "List of supported switching capabilities."; + reference + "RFC 4202: Routing Extensions in Support of + Generalized Multi-Protocol Label Switching (GMPLS) + RFC 6001: Generalized MPLS (GMPLS) Protocol Extensions + for Multi-Layer and Multi-Region Networks (MLN/MRN)"; + leaf switching-capability { + type identityref { + base te-types:switching-capabilities; + } + description + "Switching capability for the client-layer adaptation."; + } + leaf encoding { + type identityref { + base te-types:lsp-encoding-types; + } + description + "Encoding supported by the client-layer adaptation."; + } + uses te-types:te-bandwidth; + } + } + } + // te-node-tunnel-termination-point-config-attributes + + grouping te-node-tunnel-termination-point-llc-list { + description + "LLCL of a TTP on a TE node."; + list local-link-connectivity { + key "link-tp-ref"; + description + "The termination capabilities between the TTP and the LTP. + This capability information can be used to compute + the tunnel path. + The Interface Adjustment Capability Descriptors (IACDs) + (defined in RFC 6001) on each LTP can be derived from + this list."; + reference + "RFC 6001: Generalized MPLS (GMPLS) Protocol Extensions + for Multi-Layer and Multi-Region Networks (MLN/MRN)"; + leaf link-tp-ref { + type leafref { + path "../../../../../nt:termination-point/nt:tp-id"; + } + description + "LTP."; + } + uses te-types:label-set-info; + uses connectivity-matrix-entry-path-attributes; + } + } + // te-node-tunnel-termination-point-llc-list + + grouping te-path-element { + description + "A group of attributes defining an element in a TE path, + such as a TE node, TE link, TE atomic resource, or label."; + uses te-types:explicit-route-hop; + } + // te-path-element + + grouping te-termination-point-augment { + description + "Augmentation for a TE termination point."; + leaf te-tp-id { + type te-types:te-tp-id; + description + "An identifier that uniquely identifies a TE termination + point."; + } + container te { + must '../te-tp-id'; + presence "TE support"; + description + "Indicates TE support."; + uses te-termination-point-config; + leaf oper-status { + type te-types:te-oper-status; + config false; + description + "The current operational state of the LTP."; + } + uses geolocation-container; + } + } + // te-termination-point-augment + + grouping te-termination-point-config { + description + "TE termination point configuration grouping."; + leaf admin-status { + type te-types:te-admin-status; + description + "The administrative state of the LTP."; + } + leaf name { + type string; + description + "A descriptive name for the LTP."; + } + uses interface-switching-capability-list; + leaf inter-domain-plug-id { + type binary; + description + "A network-wide unique number that identifies on the + network a connection that supports a given inter-domain + TE link. This is a more flexible alternative to specifying + 'remote-te-node-id' and 'remote-te-link-tp-id' on a TE link + when the provider either does not know 'remote-te-node-id' + and 'remote-te-link-tp-id' or needs to give the client the + flexibility to mix and match multiple topologies."; + } + leaf-list inter-layer-lock-id { + type uint32; + description + "Inter-layer lock ID, used for path computation in a TE + topology covering multiple layers or multiple regions."; + reference + "RFC 5212: Requirements for GMPLS-Based Multi-Region and + Multi-Layer Networks (MRN/MLN) + RFC 6001: Generalized MPLS (GMPLS) Protocol Extensions + for Multi-Layer and Multi-Region Networks (MLN/MRN)"; + } + } + // te-termination-point-config + + grouping te-topologies-augment { + description + "Augmentation for TE topologies."; + container te { + presence "TE support"; + description + "Indicates TE support."; + container templates { + description + "Configuration parameters for templates used for a TE + topology."; + list node-template { + if-feature "template"; + key "name"; + leaf name { + type te-types:te-template-name; + description + "The name to identify a TE node template."; + } + description + "The list of TE node templates used to define sharable + and reusable TE node attributes."; + uses template-attributes; + uses te-node-config-attributes-template; + } + // node-template + list link-template { + if-feature "template"; + key "name"; + leaf name { + type te-types:te-template-name; + description + "The name to identify a TE link template."; + } + description + "The list of TE link templates used to define sharable + and reusable TE link attributes."; + uses template-attributes; + uses te-link-config-attributes; + } + // link-template + } + // templates + } + // te + } + // te-topologies-augment + + grouping te-topology-augment { + description + "Augmentation for a TE topology."; + uses te-types:te-topology-identifier; + container te { + must '../te-topology-identifier/provider-id' + + ' and ../te-topology-identifier/client-id' + + ' and ../te-topology-identifier/topology-id'; + presence "TE support"; + description + "Indicates TE support."; + uses te-topology-config; + uses geolocation-container; + } + } + // te-topology-augment + + grouping te-topology-config { + description + "TE topology configuration grouping."; + leaf name { + type string; + description + "Name of the TE topology. This attribute is optional and can + be specified by the operator to describe the TE topology, + which can be useful when 'network-id' (RFC 8345) is not + descriptive and not modifiable because of being generated + by the system."; + reference + "RFC 8345: A YANG Data Model for Network Topologies"; + } + leaf preference { + type uint8 { + range "1..255"; + } + description + "Specifies a preference for this topology. A lower number + indicates a higher preference."; + } + leaf optimization-criterion { + type identityref { + base te-types:objective-function-type; + } + description + "Optimization criterion applied to this topology."; + reference + "RFC 3272: Overview and Principles of Internet Traffic + Engineering"; + } + list nsrlg { + if-feature "nsrlg"; + key "id"; + description + "List of NSRLGs (Non-Shared Risk Link Groups)."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) + Recovery"; + leaf id { + type uint32; + description + "Identifies the NSRLG entry."; + } + leaf disjointness { + type te-types:te-path-disjointness; + description + "The type of resource disjointness."; + } + } + // nsrlg + } + // te-topology-config + + grouping template-attributes { + description + "Common attributes for all templates."; + leaf priority { + type uint16; + description + "The preference value for resolving conflicts between + different templates. When two or more templates specify + values for one configuration attribute, the value from the + template with the highest priority is used. + A lower number indicates a higher priority. The highest + priority is 0."; + } + leaf reference-change-policy { + type enumeration { + enum no-action { + description + "When an attribute changes in this template, the + configuration node referring to this template does + not take any action."; + } + enum not-allowed { + description + "When any configuration object has a reference to this + template, changing this template is not allowed."; + } + enum cascade { + description + "When an attribute changes in this template, the + configuration object referring to this template applies + the new attribute value to the corresponding + configuration."; + } + } + description + "This attribute specifies the action taken for a + configuration node that has a reference to this template."; + } + } + // template-attributes + + /* + * Data nodes + */ + + augment "/nw:networks/nw:network/nw:network-types" { + description + "Introduces a new network type for a TE topology."; + container te-topology { + presence "Indicates a TE topology"; + description + "Its presence identifies the TE topology type."; + } + } + + augment "/nw:networks" { + description + "Augmentation parameters for TE topologies."; + uses te-topologies-augment; + } + + augment "/nw:networks/nw:network" { + when 'nw:network-types/tet:te-topology' { + description + "Augmentation parameters apply only for networks with a + TE topology type."; + } + description + "Configuration parameters for a TE topology."; + uses te-topology-augment; + } + + augment "/nw:networks/nw:network/nw:node" { + when '../nw:network-types/tet:te-topology' { + description + "Augmentation parameters apply only for networks with a + TE topology type."; + } + description + "Configuration parameters for TE at the node level."; + leaf te-node-id { + type te-types:te-node-id; + description + "The identifier of a node in the TE topology. + A node is specific to a topology to which it belongs."; + } + container te { + must '../te-node-id' { + description + "'te-node-id' is mandatory."; + } + must 'count(../nw:supporting-node)<=1' { + description + "For a node in a TE topology, there cannot be more + than one supporting node. If multiple nodes are + abstracted, the 'underlay-topology' field is used."; + } + presence "TE support"; + description + "Indicates TE support."; + uses te-node-augment; + } + } + + augment "/nw:networks/nw:network/nt:link" { + when '../nw:network-types/tet:te-topology' { + description + "Augmentation parameters apply only for networks with a + TE topology type."; + } + description + "Configuration parameters for TE at the link level."; + container te { + must 'count(../nt:supporting-link)<=1' { + description + "For a link in a TE topology, there cannot be more + than one supporting link. If one or more link paths are + abstracted, the underlay is used."; + } + presence "TE support"; + description + "Indicates TE support."; + uses te-link-augment; + } + } + + augment "/nw:networks/nw:network/nw:node/" + + "nt:termination-point" { + when '../../nw:network-types/tet:te-topology' { + description + "Augmentation parameters apply only for networks with a + TE topology type."; + } + description + "Configuration parameters for TE at the termination point + level."; + uses te-termination-point-augment; + } + + augment "/nw:networks/nw:network/nt:link/te/bundle-stack-level/" + + "bundle/bundled-links/bundled-link" { + when '../../../../nw:network-types/tet:te-topology' { + description + "Augmentation parameters apply only for networks with a + TE topology type."; + } + description + "Augmentation for a TE bundled link."; + leaf src-tp-ref { + type leafref { + path "../../../../../nw:node[nw:node-id = " + + "current()/../../../../nt:source/" + + "nt:source-node]/" + + "nt:termination-point/nt:tp-id"; + require-instance true; + } + description + "Reference to another TE termination point on the + same source node."; + } + leaf des-tp-ref { + type leafref { + path "../../../../../nw:node[nw:node-id = " + + "current()/../../../../nt:destination/" + + "nt:dest-node]/" + + "nt:termination-point/nt:tp-id"; + require-instance true; + } + description + "Reference to another TE termination point on the + same destination node."; + } + } + + augment "/nw:networks/nw:network/nw:node/te/" + + "information-source-entry/connectivity-matrices/" + + "connectivity-matrix" { + when '../../../../../nw:network-types/tet:te-topology' { + description + "Augmentation parameters apply only for networks with a + TE topology type."; + } + description + "Augmentation for the TE node connectivity matrix."; + uses te-node-connectivity-matrix-attributes; + } + + augment "/nw:networks/nw:network/nw:node/te/te-node-attributes/" + + "connectivity-matrices/connectivity-matrix" { + when '../../../../../nw:network-types/tet:te-topology' { + description + "Augmentation parameters apply only for networks with a + TE topology type."; + } + description + "Augmentation for the TE node connectivity matrix."; + uses te-node-connectivity-matrix-attributes; + } + + augment "/nw:networks/nw:network/nw:node/te/" + + "tunnel-termination-point/local-link-connectivities" { + when '../../../../nw:network-types/tet:te-topology' { + description + "Augmentation parameters apply only for networks with a + TE topology type."; + } + description + "Augmentation for TE node TTP LLCs (Local Link + Connectivities)."; + uses te-node-tunnel-termination-point-llc-list; + } +} diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-te-types@2020-06-10.yang b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-te-types@2020-06-10.yang new file mode 100644 index 000000000..6fc0544de --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-te-types@2020-06-10.yang @@ -0,0 +1,3379 @@ +module ietf-te-types { + yang-version 1.1; + namespace "urn:ietf:params:xml:ns:yang:ietf-te-types"; + prefix te-types; + + import ietf-inet-types { + prefix inet; + reference + "RFC 6991: Common YANG Data Types"; + } + import ietf-yang-types { + prefix yang; + reference + "RFC 6991: Common YANG Data Types"; + } + import ietf-routing-types { + prefix rt-types; + reference + "RFC 8294: Common YANG Data Types for the Routing Area"; + } + + organization + "IETF Traffic Engineering Architecture and Signaling (TEAS) + Working Group"; + contact + "WG Web: + WG List: + + Editor: Tarek Saad + + + Editor: Rakesh Gandhi + + + Editor: Vishnu Pavan Beeram + + + Editor: Xufeng Liu + + + Editor: Igor Bryskin + "; + description + "This YANG module contains a collection of generally useful + YANG data type definitions specific to TE. The model fully + conforms to the Network Management Datastore Architecture + (NMDA). + + The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL + NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED', + 'MAY', and 'OPTIONAL' in this document are to be interpreted as + described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, + they appear in all capitals, as shown here. + + Copyright (c) 2020 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject to + the license terms contained in, the Simplified BSD License set + forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (https://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 8776; see the + RFC itself for full legal notices."; + + revision 2020-06-10 { + description + "Latest revision of TE types."; + reference + "RFC 8776: Common YANG Data Types for Traffic Engineering"; + } + + /** + * Typedefs + */ + + typedef admin-group { + type yang:hex-string { + /* 01:02:03:04 */ + length "1..11"; + } + description + "Administrative group / resource class / color representation + in 'hex-string' type. + The most significant byte in the hex-string is the farthest + to the left in the byte sequence. Leading zero bytes in the + configured value may be omitted for brevity."; + reference + "RFC 3630: Traffic Engineering (TE) Extensions to OSPF + Version 2 + RFC 5305: IS-IS Extensions for Traffic Engineering + RFC 7308: Extended Administrative Groups in MPLS Traffic + Engineering (MPLS-TE)"; + } + + typedef admin-groups { + type union { + type admin-group; + type extended-admin-group; + } + description + "Derived types for TE administrative groups."; + } + + typedef extended-admin-group { + type yang:hex-string; + description + "Extended administrative group / resource class / color + representation in 'hex-string' type. + The most significant byte in the hex-string is the farthest + to the left in the byte sequence. Leading zero bytes in the + configured value may be omitted for brevity."; + reference + "RFC 7308: Extended Administrative Groups in MPLS Traffic + Engineering (MPLS-TE)"; + } + + typedef path-attribute-flags { + type union { + type identityref { + base session-attributes-flags; + } + type identityref { + base lsp-attributes-flags; + } + } + description + "Path attributes flags type."; + } + + typedef performance-metrics-normality { + type enumeration { + enum unknown { + value 0; + description + "Unknown."; + } + enum normal { + value 1; + description + "Normal. Indicates that the anomalous bit is not set."; + } + enum abnormal { + value 2; + description + "Abnormal. Indicates that the anomalous bit is set."; + } + } + description + "Indicates whether a performance metric is normal (anomalous + bit not set), abnormal (anomalous bit set), or unknown."; + reference + "RFC 7471: OSPF Traffic Engineering (TE) Metric Extensions + RFC 7823: Performance-Based Path Selection for Explicitly + Routed Label Switched Paths (LSPs) Using TE Metric + Extensions + RFC 8570: IS-IS Traffic Engineering (TE) Metric Extensions"; + } + + typedef srlg { + type uint32; + description + "SRLG type."; + reference + "RFC 4203: OSPF Extensions in Support of Generalized + Multi-Protocol Label Switching (GMPLS) + RFC 5307: IS-IS Extensions in Support of Generalized + Multi-Protocol Label Switching (GMPLS)"; + } + + typedef te-common-status { + type enumeration { + enum up { + description + "Enabled."; + } + enum down { + description + "Disabled."; + } + enum testing { + description + "In some test mode."; + } + enum preparing-maintenance { + description + "The resource is disabled in the control plane to prepare + for a graceful shutdown for maintenance purposes."; + reference + "RFC 5817: Graceful Shutdown in MPLS and Generalized MPLS + Traffic Engineering Networks"; + } + enum maintenance { + description + "The resource is disabled in the data plane for maintenance + purposes."; + } + enum unknown { + description + "Status is unknown."; + } + } + description + "Defines a type representing the common states of a TE + resource."; + } + + typedef te-bandwidth { + type string { + pattern '0[xX](0((\.0?)?[pP](\+)?0?|(\.0?))|' + + '1(\.([\da-fA-F]{0,5}[02468aAcCeE]?)?)?' + + '[pP](\+)?(12[0-7]|' + + '1[01]\d|0?\d?\d)?)|0[xX][\da-fA-F]{1,8}|\d+' + + '(,(0[xX](0((\.0?)?[pP](\+)?0?|(\.0?))|' + + '1(\.([\da-fA-F]{0,5}[02468aAcCeE]?)?)?' + + '[pP](\+)?(12[0-7]|' + + '1[01]\d|0?\d?\d)?)|0[xX][\da-fA-F]{1,8}|\d+))*'; + } + description + "This is the generic bandwidth type. It is a string containing + a list of numbers separated by commas, where each of these + numbers can be non-negative decimal, hex integer, or + hex float: + + (dec | hex | float)[*(','(dec | hex | float))] + + For the packet-switching type, the string encoding follows + the type 'bandwidth-ieee-float32' as defined in RFC 8294 + (e.g., 0x1p10), where the units are in bytes per second. + + For the Optical Transport Network (OTN) switching type, + a list of integers can be used, such as '0,2,3,1', indicating + two ODU0s and one ODU3. ('ODU' stands for 'Optical Data + Unit'.) For Dense Wavelength Division Multiplexing (DWDM), + a list of pairs of slot numbers and widths can be used, + such as '0,2,3,3', indicating a frequency slot 0 with + slot width 2 and a frequency slot 3 with slot width 3. + Canonically, the string is represented as all lowercase and in + hex, where the prefix '0x' precedes the hex number."; + reference + "RFC 8294: Common YANG Data Types for the Routing Area + ITU-T Recommendation G.709: Interfaces for the + optical transport network"; + } + + typedef te-ds-class { + type uint8 { + range "0..7"; + } + description + "The Differentiated Services Class-Type of traffic."; + reference + "RFC 4124: Protocol Extensions for Support of Diffserv-aware + MPLS Traffic Engineering, Section 4.3.1"; + } + + typedef te-global-id { + type uint32; + description + "An identifier to uniquely identify an operator, which can be + either a provider or a client. + The definition of this type is taken from RFCs 6370 and 5003. + This attribute type is used solely to provide a globally + unique context for TE topologies."; + reference + "RFC 5003: Attachment Individual Identifier (AII) Types for + Aggregation + RFC 6370: MPLS Transport Profile (MPLS-TP) Identifiers"; + } + + typedef te-hop-type { + type enumeration { + enum loose { + description + "A loose hop in an explicit path."; + } + enum strict { + description + "A strict hop in an explicit path."; + } + } + description + "Enumerated type for specifying loose or strict paths."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels, + Section 4.3.3"; + } + + typedef te-link-access-type { + type enumeration { + enum point-to-point { + description + "The link is point-to-point."; + } + enum multi-access { + description + "The link is multi-access, including broadcast and NBMA."; + } + } + description + "Defines a type representing the access type of a TE link."; + reference + "RFC 3630: Traffic Engineering (TE) Extensions to OSPF + Version 2"; + } + + typedef te-label-direction { + type enumeration { + enum forward { + description + "Label allocated for the forward LSP direction."; + } + enum reverse { + description + "Label allocated for the reverse LSP direction."; + } + } + description + "Enumerated type for specifying the forward or reverse + label."; + } + + typedef te-link-direction { + type enumeration { + enum incoming { + description + "The explicit route represents an incoming link on + a node."; + } + enum outgoing { + description + "The explicit route represents an outgoing link on + a node."; + } + } + description + "Enumerated type for specifying the direction of a link on + a node."; + } + + typedef te-metric { + type uint32; + description + "TE metric."; + reference + "RFC 3785: Use of Interior Gateway Protocol (IGP) Metric as a + second MPLS Traffic Engineering (TE) Metric"; + } + + typedef te-node-id { + type yang:dotted-quad; + description + "A type representing the identifier for a node in a TE + topology. + The identifier is represented as 4 octets in dotted-quad + notation. + This attribute MAY be mapped to the Router Address TLV + described in Section 2.4.1 of RFC 3630, the TE Router ID + described in Section 3 of RFC 6827, the Traffic Engineering + Router ID TLV described in Section 4.3 of RFC 5305, or the + TE Router ID TLV described in Section 3.2.1 of RFC 6119. + The reachability of such a TE node MAY be achieved by a + mechanism such as that described in Section 6.2 of RFC 6827."; + reference + "RFC 3630: Traffic Engineering (TE) Extensions to OSPF + Version 2, Section 2.4.1 + RFC 5305: IS-IS Extensions for Traffic Engineering, + Section 4.3 + RFC 6119: IPv6 Traffic Engineering in IS-IS, Section 3.2.1 + RFC 6827: Automatically Switched Optical Network (ASON) + Routing for OSPFv2 Protocols, Section 3"; + } + + typedef te-oper-status { + type te-common-status; + description + "Defines a type representing the operational status of + a TE resource."; + } + + typedef te-admin-status { + type te-common-status; + description + "Defines a type representing the administrative status of + a TE resource."; + } + + typedef te-path-disjointness { + type bits { + bit node { + position 0; + description + "Node disjoint."; + } + bit link { + position 1; + description + "Link disjoint."; + } + bit srlg { + position 2; + description + "SRLG (Shared Risk Link Group) disjoint."; + } + } + description + "Type of the resource disjointness for a TE tunnel path."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) Recovery"; + } + + typedef te-recovery-status { + type enumeration { + enum normal { + description + "Both the recovery span and the working span are fully + allocated and active, data traffic is being + transported over (or selected from) the working + span, and no trigger events are reported."; + } + enum recovery-started { + description + "The recovery action has been started but not completed."; + } + enum recovery-succeeded { + description + "The recovery action has succeeded. The working span has + reported a failure/degrade condition, and the user traffic + is being transported (or selected) on the recovery span."; + } + enum recovery-failed { + description + "The recovery action has failed."; + } + enum reversion-started { + description + "The reversion has started."; + } + enum reversion-succeeded { + description + "The reversion action has succeeded."; + } + enum reversion-failed { + description + "The reversion has failed."; + } + enum recovery-unavailable { + description + "The recovery is unavailable, as a result of either an + operator's lockout command or a failure condition + detected on the recovery span."; + } + enum recovery-admin { + description + "The operator has issued a command to switch the user + traffic to the recovery span."; + } + enum wait-to-restore { + description + "The recovery domain is recovering from a failure/degrade + condition on the working span that is being controlled by + the Wait-to-Restore (WTR) timer."; + } + } + description + "Defines the status of a recovery action."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS) + RFC 6378: MPLS Transport Profile (MPLS-TP) Linear Protection"; + } + + typedef te-template-name { + type string { + pattern '/?([a-zA-Z0-9\-_.]+)(/[a-zA-Z0-9\-_.]+)*'; + } + description + "A type for the name of a TE node template or TE link + template."; + } + + typedef te-topology-event-type { + type enumeration { + enum add { + value 0; + description + "A TE node or TE link has been added."; + } + enum remove { + value 1; + description + "A TE node or TE link has been removed."; + } + enum update { + value 2; + description + "A TE node or TE link has been updated."; + } + } + description + "TE event type for notifications."; + } + + typedef te-topology-id { + type union { + type string { + length "0"; + // empty string + } + type string { + pattern '([a-zA-Z0-9\-_.]+:)*' + + '/?([a-zA-Z0-9\-_.]+)(/[a-zA-Z0-9\-_.]+)*'; + } + } + description + "An identifier for a topology. + It is optional to have one or more prefixes at the beginning, + separated by colons. The prefixes can be 'network-types' as + defined in the 'ietf-network' module in RFC 8345, to help the + user better understand the topology before further inquiry + is made."; + reference + "RFC 8345: A YANG Data Model for Network Topologies"; + } + + typedef te-tp-id { + type union { + type uint32; + // Unnumbered + type inet:ip-address; + // IPv4 or IPv6 address + } + description + "An identifier for a TE link endpoint on a node. + This attribute is mapped to a local or remote link identifier + as defined in RFCs 3630 and 5305."; + reference + "RFC 3630: Traffic Engineering (TE) Extensions to OSPF + Version 2 + RFC 5305: IS-IS Extensions for Traffic Engineering"; + } + + /* TE features */ + + feature p2mp-te { + description + "Indicates support for Point-to-Multipoint TE (P2MP-TE)."; + reference + "RFC 4875: Extensions to Resource Reservation Protocol - + Traffic Engineering (RSVP-TE) for Point-to-Multipoint TE + Label Switched Paths (LSPs)"; + } + + feature frr-te { + description + "Indicates support for TE Fast Reroute (FRR)."; + reference + "RFC 4090: Fast Reroute Extensions to RSVP-TE for LSP Tunnels"; + } + + feature extended-admin-groups { + description + "Indicates support for TE link extended administrative + groups."; + reference + "RFC 7308: Extended Administrative Groups in MPLS Traffic + Engineering (MPLS-TE)"; + } + + feature named-path-affinities { + description + "Indicates support for named path affinities."; + } + + feature named-extended-admin-groups { + description + "Indicates support for named extended administrative groups."; + } + + feature named-srlg-groups { + description + "Indicates support for named SRLG groups."; + } + + feature named-path-constraints { + description + "Indicates support for named path constraints."; + } + + feature path-optimization-metric { + description + "Indicates support for path optimization metrics."; + } + + feature path-optimization-objective-function { + description + "Indicates support for path optimization objective functions."; + } + + /* + * Identities + */ + + identity session-attributes-flags { + description + "Base identity for the RSVP-TE session attributes flags."; + } + + identity local-protection-desired { + base session-attributes-flags; + description + "Local protection is desired."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels, + Section 4.7.1"; + } + + identity se-style-desired { + base session-attributes-flags; + description + "Shared explicit style, to allow the LSP to be established + and share resources with the old LSP."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels"; + } + + identity local-recording-desired { + base session-attributes-flags; + description + "Label recording is desired."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels, + Section 4.7.1"; + } + + identity bandwidth-protection-desired { + base session-attributes-flags; + description + "Requests FRR bandwidth protection on LSRs, if present."; + reference + "RFC 4090: Fast Reroute Extensions to RSVP-TE for LSP Tunnels"; + } + + identity node-protection-desired { + base session-attributes-flags; + description + "Requests FRR node protection on LSRs, if present."; + reference + "RFC 4090: Fast Reroute Extensions to RSVP-TE for LSP Tunnels"; + } + + identity path-reevaluation-request { + base session-attributes-flags; + description + "This flag indicates that a path re-evaluation (of the + current path in use) is requested. Note that this does + not trigger any LSP reroutes but instead just signals a + request to evaluate whether a preferable path exists."; + reference + "RFC 4736: Reoptimization of Multiprotocol Label Switching + (MPLS) Traffic Engineering (TE) Loosely Routed Label Switched + Path (LSP)"; + } + + identity soft-preemption-desired { + base session-attributes-flags; + description + "Soft preemption of LSP resources is desired."; + reference + "RFC 5712: MPLS Traffic Engineering Soft Preemption"; + } + + identity lsp-attributes-flags { + description + "Base identity for LSP attributes flags."; + } + + identity end-to-end-rerouting-desired { + base lsp-attributes-flags; + description + "Indicates end-to-end rerouting behavior for an LSP + undergoing establishment. This MAY also be used to + specify the behavior of end-to-end LSP recovery for + established LSPs."; + reference + "RFC 4920: Crankback Signaling Extensions for MPLS and GMPLS + RSVP-TE + RFC 5420: Encoding of Attributes for MPLS LSP Establishment + Using Resource Reservation Protocol Traffic Engineering + (RSVP-TE) + RFC 7570: Label Switched Path (LSP) Attribute in the Explicit + Route Object (ERO)"; + } + + identity boundary-rerouting-desired { + base lsp-attributes-flags; + description + "Indicates boundary rerouting behavior for an LSP undergoing + establishment. This MAY also be used to specify + segment-based LSP recovery through nested crankback for + established LSPs. The boundary Area Border Router (ABR) / + Autonomous System Border Router (ASBR) can decide to forward + the PathErr message upstream to either an upstream boundary + ABR/ASBR or the ingress LSR. Alternatively, it can try to + select another egress boundary LSR."; + reference + "RFC 4920: Crankback Signaling Extensions for MPLS and GMPLS + RSVP-TE + RFC 5420: Encoding of Attributes for MPLS LSP Establishment + Using Resource Reservation Protocol Traffic Engineering + (RSVP-TE) + RFC 7570: Label Switched Path (LSP) Attribute in the Explicit + Route Object (ERO)"; + } + + identity segment-based-rerouting-desired { + base lsp-attributes-flags; + description + "Indicates segment-based rerouting behavior for an LSP + undergoing establishment. This MAY also be used to specify + segment-based LSP recovery for established LSPs."; + reference + "RFC 4920: Crankback Signaling Extensions for MPLS and GMPLS + RSVP-TE + RFC 5420: Encoding of Attributes for MPLS LSP Establishment + Using Resource Reservation Protocol Traffic Engineering + (RSVP-TE) + RFC 7570: Label Switched Path (LSP) Attribute in the Explicit + Route Object (ERO)"; + } + + identity lsp-integrity-required { + base lsp-attributes-flags; + description + "Indicates that LSP integrity is required."; + reference + "RFC 4875: Extensions to Resource Reservation Protocol - + Traffic Engineering (RSVP-TE) for Point-to-Multipoint TE + Label Switched Paths (LSPs) + RFC 7570: Label Switched Path (LSP) Attribute in the Explicit + Route Object (ERO)"; + } + + identity contiguous-lsp-desired { + base lsp-attributes-flags; + description + "Indicates that a contiguous LSP is desired."; + reference + "RFC 5151: Inter-Domain MPLS and GMPLS Traffic Engineering -- + Resource Reservation Protocol-Traffic Engineering (RSVP-TE) + Extensions + RFC 7570: Label Switched Path (LSP) Attribute in the Explicit + Route Object (ERO)"; + } + + identity lsp-stitching-desired { + base lsp-attributes-flags; + description + "Indicates that LSP stitching is desired."; + reference + "RFC 5150: Label Switched Path Stitching with Generalized + Multiprotocol Label Switching Traffic Engineering (GMPLS TE) + RFC 7570: Label Switched Path (LSP) Attribute in the Explicit + Route Object (ERO)"; + } + + identity pre-planned-lsp-flag { + base lsp-attributes-flags; + description + "Indicates that the LSP MUST be provisioned in the + control plane only."; + reference + "RFC 6001: Generalized MPLS (GMPLS) Protocol Extensions for + Multi-Layer and Multi-Region Networks (MLN/MRN) + RFC 7570: Label Switched Path (LSP) Attribute in the Explicit + Route Object (ERO)"; + } + + identity non-php-behavior-flag { + base lsp-attributes-flags; + description + "Indicates that non-PHP (non-Penultimate Hop Popping) behavior + for the LSP is desired."; + reference + "RFC 6511: Non-Penultimate Hop Popping Behavior and Out-of-Band + Mapping for RSVP-TE Label Switched Paths + RFC 7570: Label Switched Path (LSP) Attribute in the Explicit + Route Object (ERO)"; + } + + identity oob-mapping-flag { + base lsp-attributes-flags; + description + "Indicates that signaling of the egress binding information is + out of band (e.g., via the Border Gateway Protocol (BGP))."; + reference + "RFC 6511: Non-Penultimate Hop Popping Behavior and Out-of-Band + Mapping for RSVP-TE Label Switched Paths + RFC 7570: Label Switched Path (LSP) Attribute in the Explicit + Route Object (ERO)"; + } + + identity entropy-label-capability { + base lsp-attributes-flags; + description + "Indicates entropy label capability."; + reference + "RFC 6790: The Use of Entropy Labels in MPLS Forwarding + RFC 7570: Label Switched Path (LSP) Attribute in the Explicit + Route Object (ERO)"; + } + + identity oam-mep-entity-desired { + base lsp-attributes-flags; + description + "OAM Maintenance Entity Group End Point (MEP) entities + desired."; + reference + "RFC 7260: GMPLS RSVP-TE Extensions for Operations, + Administration, and Maintenance (OAM) Configuration"; + } + + identity oam-mip-entity-desired { + base lsp-attributes-flags; + description + "OAM Maintenance Entity Group Intermediate Points (MIP) + entities desired."; + reference + "RFC 7260: GMPLS RSVP-TE Extensions for Operations, + Administration, and Maintenance (OAM) Configuration"; + } + + identity srlg-collection-desired { + base lsp-attributes-flags; + description + "SRLG collection desired."; + reference + "RFC 7570: Label Switched Path (LSP) Attribute in the Explicit + Route Object (ERO) + RFC 8001: RSVP-TE Extensions for Collecting Shared Risk + Link Group (SRLG) Information"; + } + + identity loopback-desired { + base lsp-attributes-flags; + description + "This flag indicates that a particular node on the LSP is + required to enter loopback mode. This can also be + used to specify the loopback state of the node."; + reference + "RFC 7571: GMPLS RSVP-TE Extensions for Lock Instruct and + Loopback"; + } + + identity p2mp-te-tree-eval-request { + base lsp-attributes-flags; + description + "P2MP-TE tree re-evaluation request."; + reference + "RFC 8149: RSVP Extensions for Reoptimization of Loosely Routed + Point-to-Multipoint Traffic Engineering Label Switched Paths + (LSPs)"; + } + + identity rtm-set-desired { + base lsp-attributes-flags; + description + "Residence Time Measurement (RTM) attribute flag requested."; + reference + "RFC 8169: Residence Time Measurement in MPLS Networks"; + } + + identity link-protection-type { + description + "Base identity for the link protection type."; + } + + identity link-protection-unprotected { + base link-protection-type; + description + "Unprotected link type."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) Recovery"; + } + + identity link-protection-extra-traffic { + base link-protection-type; + description + "Extra-Traffic protected link type."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity link-protection-shared { + base link-protection-type; + description + "Shared protected link type."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) Recovery"; + } + + identity link-protection-1-for-1 { + base link-protection-type; + description + "One-for-one (1:1) protected link type."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) Recovery"; + } + + identity link-protection-1-plus-1 { + base link-protection-type; + description + "One-plus-one (1+1) protected link type."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) Recovery"; + } + + identity link-protection-enhanced { + base link-protection-type; + description + "A compound link protection type derived from the underlay + TE tunnel protection configuration supporting the TE link."; + } + + identity association-type { + description + "Base identity for the tunnel association."; + } + + identity association-type-recovery { + base association-type; + description + "Association type for recovery, used to associate LSPs of the + same tunnel for recovery."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) Recovery + RFC 6780: RSVP ASSOCIATION Object Extensions"; + } + + identity association-type-resource-sharing { + base association-type; + description + "Association type for resource sharing, used to enable + resource sharing during make-before-break."; + reference + "RFC 4873: GMPLS Segment Recovery + RFC 6780: RSVP ASSOCIATION Object Extensions"; + } + + identity association-type-double-sided-bidir { + base association-type; + description + "Association type for double-sided bidirectional LSPs, + used to associate two LSPs of two tunnels that are + independently configured on either endpoint."; + reference + "RFC 7551: RSVP-TE Extensions for Associated Bidirectional + Label Switched Paths (LSPs)"; + } + + identity association-type-single-sided-bidir { + base association-type; + description + "Association type for single-sided bidirectional LSPs, + used to associate two LSPs of two tunnels, where one + tunnel is configured on one side/endpoint and the other + tunnel is dynamically created on the other endpoint."; + reference + "RFC 6780: RSVP ASSOCIATION Object Extensions + RFC 7551: RSVP-TE Extensions for Associated Bidirectional + Label Switched Paths (LSPs)"; + } + + identity objective-function-type { + description + "Base objective function type."; + } + + identity of-minimize-cost-path { + base objective-function-type; + description + "Objective function for minimizing path cost."; + reference + "RFC 5541: Encoding of Objective Functions in the Path + Computation Element Communication Protocol (PCEP)"; + } + + identity of-minimize-load-path { + base objective-function-type; + description + "Objective function for minimizing the load on one or more + paths."; + reference + "RFC 5541: Encoding of Objective Functions in the Path + Computation Element Communication Protocol (PCEP)"; + } + + identity of-maximize-residual-bandwidth { + base objective-function-type; + description + "Objective function for maximizing residual bandwidth."; + reference + "RFC 5541: Encoding of Objective Functions in the Path + Computation Element Communication Protocol (PCEP)"; + } + + identity of-minimize-agg-bandwidth-consumption { + base objective-function-type; + description + "Objective function for minimizing aggregate bandwidth + consumption."; + reference + "RFC 5541: Encoding of Objective Functions in the Path + Computation Element Communication Protocol (PCEP)"; + } + + identity of-minimize-load-most-loaded-link { + base objective-function-type; + description + "Objective function for minimizing the load on the link that + is carrying the highest load."; + reference + "RFC 5541: Encoding of Objective Functions in the Path + Computation Element Communication Protocol (PCEP)"; + } + + identity of-minimize-cost-path-set { + base objective-function-type; + description + "Objective function for minimizing the cost on a path set."; + reference + "RFC 5541: Encoding of Objective Functions in the Path + Computation Element Communication Protocol (PCEP)"; + } + + identity path-computation-method { + description + "Base identity for supported path computation mechanisms."; + } + + identity path-locally-computed { + base path-computation-method; + description + "Indicates a constrained-path LSP in which the + path is computed by the local LER."; + reference + "RFC 3272: Overview and Principles of Internet Traffic + Engineering, Section 5.4"; + } + + identity path-externally-queried { + base path-computation-method; + description + "Constrained-path LSP in which the path is obtained by + querying an external source, such as a PCE server. + In the case that an LSP is defined to be externally queried, + it may also have associated explicit definitions (provided + to the external source to aid computation). The path that is + returned by the external source may require further local + computation on the device."; + reference + "RFC 3272: Overview and Principles of Internet Traffic + Engineering + RFC 4657: Path Computation Element (PCE) Communication + Protocol Generic Requirements"; + } + + identity path-explicitly-defined { + base path-computation-method; + description + "Constrained-path LSP in which the path is + explicitly specified as a collection of strict and/or loose + hops."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels + RFC 3272: Overview and Principles of Internet Traffic + Engineering"; + } + + identity lsp-metric-type { + description + "Base identity for the LSP metric specification types."; + } + + identity lsp-metric-relative { + base lsp-metric-type; + description + "The metric specified for the LSPs to which this identity + refers is specified as a value relative to the IGP metric + cost to the LSP's tail end."; + reference + "RFC 4657: Path Computation Element (PCE) Communication + Protocol Generic Requirements"; + } + + identity lsp-metric-absolute { + base lsp-metric-type; + description + "The metric specified for the LSPs to which this identity + refers is specified as an absolute value."; + reference + "RFC 4657: Path Computation Element (PCE) Communication + Protocol Generic Requirements"; + } + + identity lsp-metric-inherited { + base lsp-metric-type; + description + "The metric for the LSPs to which this identity refers is + not specified explicitly; rather, it is directly inherited + from the IGP cost."; + reference + "RFC 4657: Path Computation Element (PCE) Communication + Protocol Generic Requirements"; + } + + identity te-tunnel-type { + description + "Base identity from which specific tunnel types are derived."; + } + + identity te-tunnel-p2p { + base te-tunnel-type; + description + "TE Point-to-Point (P2P) tunnel type."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels"; + } + + identity te-tunnel-p2mp { + base te-tunnel-type; + description + "TE P2MP tunnel type."; + reference + "RFC 4875: Extensions to Resource Reservation Protocol - + Traffic Engineering (RSVP-TE) for Point-to-Multipoint TE + Label Switched Paths (LSPs)"; + } + + identity tunnel-action-type { + description + "Base identity from which specific tunnel action types + are derived."; + } + + identity tunnel-action-resetup { + base tunnel-action-type; + description + "TE tunnel action that tears down the tunnel's current LSP + (if any) and attempts to re-establish a new LSP."; + } + + identity tunnel-action-reoptimize { + base tunnel-action-type; + description + "TE tunnel action that reoptimizes the placement of the + tunnel LSP(s)."; + } + + identity tunnel-action-switchpath { + base tunnel-action-type; + description + "TE tunnel action that switches the tunnel's LSP to use the + specified path."; + } + + identity te-action-result { + description + "Base identity from which specific TE action results + are derived."; + } + + identity te-action-success { + base te-action-result; + description + "TE action was successful."; + } + + identity te-action-fail { + base te-action-result; + description + "TE action failed."; + } + + identity tunnel-action-inprogress { + base te-action-result; + description + "TE action is in progress."; + } + + identity tunnel-admin-state-type { + description + "Base identity for TE tunnel administrative states."; + } + + identity tunnel-admin-state-up { + base tunnel-admin-state-type; + description + "Tunnel's administrative state is up."; + } + + identity tunnel-admin-state-down { + base tunnel-admin-state-type; + description + "Tunnel's administrative state is down."; + } + + identity tunnel-state-type { + description + "Base identity for TE tunnel states."; + } + + identity tunnel-state-up { + base tunnel-state-type; + description + "Tunnel's state is up."; + } + + identity tunnel-state-down { + base tunnel-state-type; + description + "Tunnel's state is down."; + } + + identity lsp-state-type { + description + "Base identity for TE LSP states."; + } + + identity lsp-path-computing { + base lsp-state-type; + description + "State path computation is in progress."; + } + + identity lsp-path-computation-ok { + base lsp-state-type; + description + "State path computation was successful."; + } + + identity lsp-path-computation-failed { + base lsp-state-type; + description + "State path computation failed."; + } + + identity lsp-state-setting-up { + base lsp-state-type; + description + "State is being set up."; + } + + identity lsp-state-setup-ok { + base lsp-state-type; + description + "State setup was successful."; + } + + identity lsp-state-setup-failed { + base lsp-state-type; + description + "State setup failed."; + } + + identity lsp-state-up { + base lsp-state-type; + description + "State is up."; + } + + identity lsp-state-tearing-down { + base lsp-state-type; + description + "State is being torn down."; + } + + identity lsp-state-down { + base lsp-state-type; + description + "State is down."; + } + + identity path-invalidation-action-type { + description + "Base identity for TE path invalidation action types."; + } + + identity path-invalidation-action-drop { + base path-invalidation-action-type; + description + "Upon invalidation of the TE tunnel path, the tunnel remains + valid, but any packet mapped over the tunnel is dropped."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels, + Section 2.5"; + } + + identity path-invalidation-action-teardown { + base path-invalidation-action-type; + description + "TE path invalidation action teardown."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels, + Section 2.5"; + } + + identity lsp-restoration-type { + description + "Base identity from which LSP restoration types are derived."; + } + + identity lsp-restoration-restore-any { + base lsp-restoration-type; + description + "Any LSP affected by a failure is restored."; + } + + identity lsp-restoration-restore-all { + base lsp-restoration-type; + description + "Affected LSPs are restored after all LSPs of the tunnel are + broken."; + } + + identity restoration-scheme-type { + description + "Base identity for LSP restoration schemes."; + } + + identity restoration-scheme-preconfigured { + base restoration-scheme-type; + description + "Restoration LSP is preconfigured prior to the failure."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity restoration-scheme-precomputed { + base restoration-scheme-type; + description + "Restoration LSP is precomputed prior to the failure."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity restoration-scheme-presignaled { + base restoration-scheme-type; + description + "Restoration LSP is presignaled prior to the failure."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity lsp-protection-type { + description + "Base identity from which LSP protection types are derived."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) Recovery"; + } + + identity lsp-protection-unprotected { + base lsp-protection-type; + description + "'Unprotected' LSP protection type."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) Recovery"; + } + + identity lsp-protection-reroute-extra { + base lsp-protection-type; + description + "'(Full) Rerouting' LSP protection type."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) Recovery"; + } + + identity lsp-protection-reroute { + base lsp-protection-type; + description + "'Rerouting without Extra-Traffic' LSP protection type."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) Recovery"; + } + + identity lsp-protection-1-for-n { + base lsp-protection-type; + description + "'1:N Protection with Extra-Traffic' LSP protection type."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) Recovery"; + } + + identity lsp-protection-1-for-1 { + base lsp-protection-type; + description + "LSP protection '1:1 Protection Type'."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) Recovery"; + } + + identity lsp-protection-unidir-1-plus-1 { + base lsp-protection-type; + description + "'1+1 Unidirectional Protection' LSP protection type."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) Recovery"; + } + + identity lsp-protection-bidir-1-plus-1 { + base lsp-protection-type; + description + "'1+1 Bidirectional Protection' LSP protection type."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) Recovery"; + } + + identity lsp-protection-extra-traffic { + base lsp-protection-type; + description + "Extra-Traffic LSP protection type."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity lsp-protection-state { + description + "Base identity of protection states for reporting purposes."; + } + + identity normal { + base lsp-protection-state; + description + "Normal state."; + } + + identity signal-fail-of-protection { + base lsp-protection-state; + description + "The protection transport entity has a signal fail condition + that is of higher priority than the forced switchover + command."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity lockout-of-protection { + base lsp-protection-state; + description + "A Loss of Protection (LoP) command is active."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity forced-switch { + base lsp-protection-state; + description + "A forced switchover command is active."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity signal-fail { + base lsp-protection-state; + description + "There is a signal fail condition on either the working path + or the protection path."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity signal-degrade { + base lsp-protection-state; + description + "There is a signal degrade condition on either the working + path or the protection path."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity manual-switch { + base lsp-protection-state; + description + "A manual switchover command is active."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity wait-to-restore { + base lsp-protection-state; + description + "A WTR timer is running."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity do-not-revert { + base lsp-protection-state; + description + "A Do Not Revert (DNR) condition is active because of + non-revertive behavior."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity failure-of-protocol { + base lsp-protection-state; + description + "LSP protection is not working because of a protocol failure + condition."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity protection-external-commands { + description + "Base identity from which protection-related external commands + used for troubleshooting purposes are derived."; + } + + identity action-freeze { + base protection-external-commands; + description + "A temporary configuration action initiated by an operator + command that prevents any switchover action from being taken + and, as such, freezes the current state."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity clear-freeze { + base protection-external-commands; + description + "An action that clears the active freeze state."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity action-lockout-of-normal { + base protection-external-commands; + description + "A temporary configuration action initiated by an operator + command to ensure that the normal traffic is not allowed + to use the protection transport entity."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity clear-lockout-of-normal { + base protection-external-commands; + description + "An action that clears the active lockout of the + normal state."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity action-lockout-of-protection { + base protection-external-commands; + description + "A temporary configuration action initiated by an operator + command to ensure that the protection transport entity is + temporarily not available to transport a traffic signal + (either normal or Extra-Traffic)."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity action-forced-switch { + base protection-external-commands; + description + "A switchover action initiated by an operator command to switch + the Extra-Traffic signal, the normal traffic signal, or the + null signal to the protection transport entity, unless a + switchover command of equal or higher priority is in effect."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity action-manual-switch { + base protection-external-commands; + description + "A switchover action initiated by an operator command to switch + the Extra-Traffic signal, the normal traffic signal, or + the null signal to the protection transport entity, unless + a fault condition exists on other transport entities or a + switchover command of equal or higher priority is in effect."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity action-exercise { + base protection-external-commands; + description + "An action that starts testing whether or not APS communication + is operating correctly. It is of lower priority than any + other state or command."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity clear { + base protection-external-commands; + description + "An action that clears the active near-end lockout of a + protection, forced switchover, manual switchover, WTR state, + or exercise command."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity switching-capabilities { + description + "Base identity for interface switching capabilities."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity switching-psc1 { + base switching-capabilities; + description + "Packet-Switch Capable-1 (PSC-1)."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity switching-evpl { + base switching-capabilities; + description + "Ethernet Virtual Private Line (EVPL)."; + reference + "RFC 6004: Generalized MPLS (GMPLS) Support for Metro Ethernet + Forum and G.8011 Ethernet Service Switching"; + } + + identity switching-l2sc { + base switching-capabilities; + description + "Layer-2 Switch Capable (L2SC)."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity switching-tdm { + base switching-capabilities; + description + "Time-Division-Multiplex Capable (TDM)."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity switching-otn { + base switching-capabilities; + description + "OTN-TDM capable."; + reference + "RFC 7138: Traffic Engineering Extensions to OSPF for GMPLS + Control of Evolving G.709 Optical Transport Networks"; + } + + identity switching-dcsc { + base switching-capabilities; + description + "Data Channel Switching Capable (DCSC)."; + reference + "RFC 6002: Generalized MPLS (GMPLS) Data Channel + Switching Capable (DCSC) and Channel Set Label Extensions"; + } + + identity switching-lsc { + base switching-capabilities; + description + "Lambda-Switch Capable (LSC)."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity switching-fsc { + base switching-capabilities; + description + "Fiber-Switch Capable (FSC)."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity lsp-encoding-types { + description + "Base identity for encoding types."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity lsp-encoding-packet { + base lsp-encoding-types; + description + "Packet LSP encoding."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity lsp-encoding-ethernet { + base lsp-encoding-types; + description + "Ethernet LSP encoding."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity lsp-encoding-pdh { + base lsp-encoding-types; + description + "ANSI/ETSI PDH LSP encoding."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity lsp-encoding-sdh { + base lsp-encoding-types; + description + "SDH ITU-T G.707 / SONET ANSI T1.105 LSP encoding."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity lsp-encoding-digital-wrapper { + base lsp-encoding-types; + description + "Digital Wrapper LSP encoding."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity lsp-encoding-lambda { + base lsp-encoding-types; + description + "Lambda (photonic) LSP encoding."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity lsp-encoding-fiber { + base lsp-encoding-types; + description + "Fiber LSP encoding."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity lsp-encoding-fiber-channel { + base lsp-encoding-types; + description + "FiberChannel LSP encoding."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity lsp-encoding-oduk { + base lsp-encoding-types; + description + "G.709 ODUk (Digital Path) LSP encoding."; + reference + "RFC 4328: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Extensions for G.709 Optical Transport Networks + Control"; + } + + identity lsp-encoding-optical-channel { + base lsp-encoding-types; + description + "G.709 Optical Channel LSP encoding."; + reference + "RFC 4328: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Extensions for G.709 Optical Transport Networks + Control"; + } + + identity lsp-encoding-line { + base lsp-encoding-types; + description + "Line (e.g., 8B/10B) LSP encoding."; + reference + "RFC 6004: Generalized MPLS (GMPLS) Support for Metro + Ethernet Forum and G.8011 Ethernet Service Switching"; + } + + identity path-signaling-type { + description + "Base identity from which specific LSP path setup types + are derived."; + } + + identity path-setup-static { + base path-signaling-type; + description + "Static LSP provisioning path setup."; + } + + identity path-setup-rsvp { + base path-signaling-type; + description + "RSVP-TE signaling path setup."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels"; + } + + identity path-setup-sr { + base path-signaling-type; + description + "Segment-routing path setup."; + } + + identity path-scope-type { + description + "Base identity from which specific path scope types are + derived."; + } + + identity path-scope-segment { + base path-scope-type; + description + "Path scope segment."; + reference + "RFC 4873: GMPLS Segment Recovery"; + } + + identity path-scope-end-to-end { + base path-scope-type; + description + "Path scope end to end."; + reference + "RFC 4873: GMPLS Segment Recovery"; + } + + identity route-usage-type { + description + "Base identity for route usage."; + } + + identity route-include-object { + base route-usage-type; + description + "'Include route' object."; + } + + identity route-exclude-object { + base route-usage-type; + description + "'Exclude route' object."; + reference + "RFC 4874: Exclude Routes - Extension to Resource ReserVation + Protocol-Traffic Engineering (RSVP-TE)"; + } + + identity route-exclude-srlg { + base route-usage-type; + description + "Excludes SRLGs."; + reference + "RFC 4874: Exclude Routes - Extension to Resource ReserVation + Protocol-Traffic Engineering (RSVP-TE)"; + } + + identity path-metric-type { + description + "Base identity for the path metric type."; + } + + identity path-metric-te { + base path-metric-type; + description + "TE path metric."; + reference + "RFC 3785: Use of Interior Gateway Protocol (IGP) Metric as a + second MPLS Traffic Engineering (TE) Metric"; + } + + identity path-metric-igp { + base path-metric-type; + description + "IGP path metric."; + reference + "RFC 3785: Use of Interior Gateway Protocol (IGP) Metric as a + second MPLS Traffic Engineering (TE) Metric"; + } + + identity path-metric-hop { + base path-metric-type; + description + "Hop path metric."; + } + + identity path-metric-delay-average { + base path-metric-type; + description + "Average unidirectional link delay."; + reference + "RFC 7471: OSPF Traffic Engineering (TE) Metric Extensions"; + } + + identity path-metric-delay-minimum { + base path-metric-type; + description + "Minimum unidirectional link delay."; + reference + "RFC 7471: OSPF Traffic Engineering (TE) Metric Extensions"; + } + + identity path-metric-residual-bandwidth { + base path-metric-type; + description + "Unidirectional Residual Bandwidth, which is defined to be + Maximum Bandwidth (RFC 3630) minus the bandwidth currently + allocated to LSPs."; + reference + "RFC 3630: Traffic Engineering (TE) Extensions to OSPF + Version 2 + RFC 7471: OSPF Traffic Engineering (TE) Metric Extensions"; + } + + identity path-metric-optimize-includes { + base path-metric-type; + description + "A metric that optimizes the number of included resources + specified in a set."; + } + + identity path-metric-optimize-excludes { + base path-metric-type; + description + "A metric that optimizes to a maximum the number of excluded + resources specified in a set."; + } + + identity path-tiebreaker-type { + description + "Base identity for the path tiebreaker type."; + } + + identity path-tiebreaker-minfill { + base path-tiebreaker-type; + description + "Min-Fill LSP path placement."; + } + + identity path-tiebreaker-maxfill { + base path-tiebreaker-type; + description + "Max-Fill LSP path placement."; + } + + identity path-tiebreaker-random { + base path-tiebreaker-type; + description + "Random LSP path placement."; + } + + identity resource-affinities-type { + description + "Base identity for resource class affinities."; + reference + "RFC 2702: Requirements for Traffic Engineering Over MPLS"; + } + + identity resource-aff-include-all { + base resource-affinities-type; + description + "The set of attribute filters associated with a + tunnel, all of which must be present for a link + to be acceptable."; + reference + "RFC 2702: Requirements for Traffic Engineering Over MPLS + RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels"; + } + + identity resource-aff-include-any { + base resource-affinities-type; + description + "The set of attribute filters associated with a + tunnel, any of which must be present for a link + to be acceptable."; + reference + "RFC 2702: Requirements for Traffic Engineering Over MPLS + RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels"; + } + + identity resource-aff-exclude-any { + base resource-affinities-type; + description + "The set of attribute filters associated with a + tunnel, any of which renders a link unacceptable."; + reference + "RFC 2702: Requirements for Traffic Engineering Over MPLS + RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels"; + } + + identity te-optimization-criterion { + description + "Base identity for the TE optimization criteria."; + reference + "RFC 3272: Overview and Principles of Internet Traffic + Engineering"; + } + + identity not-optimized { + base te-optimization-criterion; + description + "Optimization is not applied."; + } + + identity cost { + base te-optimization-criterion; + description + "Optimized on cost."; + reference + "RFC 5541: Encoding of Objective Functions in the Path + Computation Element Communication Protocol (PCEP)"; + } + + identity delay { + base te-optimization-criterion; + description + "Optimized on delay."; + reference + "RFC 5541: Encoding of Objective Functions in the Path + Computation Element Communication Protocol (PCEP)"; + } + + identity path-computation-srlg-type { + description + "Base identity for SRLG path computation."; + } + + identity srlg-ignore { + base path-computation-srlg-type; + description + "Ignores SRLGs in the path computation."; + } + + identity srlg-strict { + base path-computation-srlg-type; + description + "Includes a strict SRLG check in the path computation."; + } + + identity srlg-preferred { + base path-computation-srlg-type; + description + "Includes a preferred SRLG check in the path computation."; + } + + identity srlg-weighted { + base path-computation-srlg-type; + description + "Includes a weighted SRLG check in the path computation."; + } + + /** + * TE bandwidth groupings + **/ + + grouping te-bandwidth { + description + "This grouping defines the generic TE bandwidth. + For some known data-plane technologies, specific modeling + structures are specified. The string-encoded 'te-bandwidth' + type is used for unspecified technologies. + The modeling structure can be augmented later for other + technologies."; + container te-bandwidth { + description + "Container that specifies TE bandwidth. The choices + can be augmented for specific data-plane technologies."; + choice technology { + default "generic"; + description + "Data-plane technology type."; + case generic { + leaf generic { + type te-bandwidth; + description + "Bandwidth specified in a generic format."; + } + } + } + } + } + + /** + * TE label groupings + **/ + + grouping te-label { + description + "This grouping defines the generic TE label. + The modeling structure can be augmented for each technology. + For unspecified technologies, 'rt-types:generalized-label' + is used."; + container te-label { + description + "Container that specifies the TE label. The choices can + be augmented for specific data-plane technologies."; + choice technology { + default "generic"; + description + "Data-plane technology type."; + case generic { + leaf generic { + type rt-types:generalized-label; + description + "TE label specified in a generic format."; + } + } + } + leaf direction { + type te-label-direction; + default "forward"; + description + "Label direction."; + } + } + } + + grouping te-topology-identifier { + description + "Augmentation for a TE topology."; + container te-topology-identifier { + description + "TE topology identifier container."; + leaf provider-id { + type te-global-id; + default "0"; + description + "An identifier to uniquely identify a provider. + If omitted, it assumes that the topology provider ID + value = 0 (the default)."; + } + leaf client-id { + type te-global-id; + default "0"; + description + "An identifier to uniquely identify a client. + If omitted, it assumes that the topology client ID + value = 0 (the default)."; + } + leaf topology-id { + type te-topology-id; + default ""; + description + "When the datastore contains several topologies, + 'topology-id' distinguishes between them. If omitted, + the default (empty) string for this leaf is assumed."; + } + } + } + + /** + * TE performance metrics groupings + **/ + + grouping performance-metrics-one-way-delay-loss { + description + "Performance Metrics (PM) information in real time that can + be applicable to links or connections. PM defined in this + grouping are applicable to generic TE PM as well as packet TE + PM."; + reference + "RFC 7471: OSPF Traffic Engineering (TE) Metric Extensions + RFC 7823: Performance-Based Path Selection for Explicitly + Routed Label Switched Paths (LSPs) Using TE Metric + Extensions + RFC 8570: IS-IS Traffic Engineering (TE) Metric Extensions"; + leaf one-way-delay { + type uint32 { + range "0..16777215"; + } + description + "One-way delay or latency in microseconds."; + } + leaf one-way-delay-normality { + type te-types:performance-metrics-normality; + description + "One-way delay normality."; + } + } + + grouping performance-metrics-two-way-delay-loss { + description + "PM information in real time that can be applicable to links or + connections. PM defined in this grouping are applicable to + generic TE PM as well as packet TE PM."; + reference + "RFC 7471: OSPF Traffic Engineering (TE) Metric Extensions + RFC 7823: Performance-Based Path Selection for Explicitly + Routed Label Switched Paths (LSPs) Using TE Metric + Extensions + RFC 8570: IS-IS Traffic Engineering (TE) Metric Extensions"; + leaf two-way-delay { + type uint32 { + range "0..16777215"; + } + description + "Two-way delay or latency in microseconds."; + } + leaf two-way-delay-normality { + type te-types:performance-metrics-normality; + description + "Two-way delay normality."; + } + } + + grouping performance-metrics-one-way-bandwidth { + description + "PM information in real time that can be applicable to links. + PM defined in this grouping are applicable to generic TE PM + as well as packet TE PM."; + reference + "RFC 7471: OSPF Traffic Engineering (TE) Metric Extensions + RFC 7823: Performance-Based Path Selection for Explicitly + Routed Label Switched Paths (LSPs) Using TE Metric + Extensions + RFC 8570: IS-IS Traffic Engineering (TE) Metric Extensions"; + leaf one-way-residual-bandwidth { + type rt-types:bandwidth-ieee-float32; + units "bytes per second"; + default "0x0p0"; + description + "Residual bandwidth that subtracts tunnel reservations from + Maximum Bandwidth (or link capacity) (RFC 3630) and + provides an aggregated remainder across QoS classes."; + reference + "RFC 3630: Traffic Engineering (TE) Extensions to OSPF + Version 2"; + } + leaf one-way-residual-bandwidth-normality { + type te-types:performance-metrics-normality; + default "normal"; + description + "Residual bandwidth normality."; + } + leaf one-way-available-bandwidth { + type rt-types:bandwidth-ieee-float32; + units "bytes per second"; + default "0x0p0"; + description + "Available bandwidth that is defined to be residual + bandwidth minus the measured bandwidth used for the + actual forwarding of non-RSVP-TE LSP packets. For a + bundled link, available bandwidth is defined to be the + sum of the component link available bandwidths."; + } + leaf one-way-available-bandwidth-normality { + type te-types:performance-metrics-normality; + default "normal"; + description + "Available bandwidth normality."; + } + leaf one-way-utilized-bandwidth { + type rt-types:bandwidth-ieee-float32; + units "bytes per second"; + default "0x0p0"; + description + "Bandwidth utilization that represents the actual + utilization of the link (i.e., as measured in the router). + For a bundled link, bandwidth utilization is defined to + be the sum of the component link bandwidth utilizations."; + } + leaf one-way-utilized-bandwidth-normality { + type te-types:performance-metrics-normality; + default "normal"; + description + "Bandwidth utilization normality."; + } + } + + grouping one-way-performance-metrics { + description + "One-way PM throttle grouping."; + leaf one-way-delay { + type uint32 { + range "0..16777215"; + } + default "0"; + description + "One-way delay or latency in microseconds."; + } + leaf one-way-residual-bandwidth { + type rt-types:bandwidth-ieee-float32; + units "bytes per second"; + default "0x0p0"; + description + "Residual bandwidth that subtracts tunnel reservations from + Maximum Bandwidth (or link capacity) (RFC 3630) and + provides an aggregated remainder across QoS classes."; + reference + "RFC 3630: Traffic Engineering (TE) Extensions to OSPF + Version 2"; + } + leaf one-way-available-bandwidth { + type rt-types:bandwidth-ieee-float32; + units "bytes per second"; + default "0x0p0"; + description + "Available bandwidth that is defined to be residual + bandwidth minus the measured bandwidth used for the + actual forwarding of non-RSVP-TE LSP packets. For a + bundled link, available bandwidth is defined to be the + sum of the component link available bandwidths."; + } + leaf one-way-utilized-bandwidth { + type rt-types:bandwidth-ieee-float32; + units "bytes per second"; + default "0x0p0"; + description + "Bandwidth utilization that represents the actual + utilization of the link (i.e., as measured in the router). + For a bundled link, bandwidth utilization is defined to + be the sum of the component link bandwidth utilizations."; + } + } + + grouping two-way-performance-metrics { + description + "Two-way PM throttle grouping."; + leaf two-way-delay { + type uint32 { + range "0..16777215"; + } + default "0"; + description + "Two-way delay or latency in microseconds."; + } + } + + grouping performance-metrics-thresholds { + description + "Grouping for configurable thresholds for measured + attributes."; + uses one-way-performance-metrics; + uses two-way-performance-metrics; + } + + grouping performance-metrics-attributes { + description + "Contains PM attributes."; + container performance-metrics-one-way { + description + "One-way link performance information in real time."; + reference + "RFC 7471: OSPF Traffic Engineering (TE) Metric Extensions + RFC 7823: Performance-Based Path Selection for Explicitly + Routed Label Switched Paths (LSPs) Using TE Metric + Extensions + RFC 8570: IS-IS Traffic Engineering (TE) Metric Extensions"; + uses performance-metrics-one-way-delay-loss; + uses performance-metrics-one-way-bandwidth; + } + container performance-metrics-two-way { + description + "Two-way link performance information in real time."; + reference + "RFC 6374: Packet Loss and Delay Measurement for MPLS + Networks"; + uses performance-metrics-two-way-delay-loss; + } + } + + grouping performance-metrics-throttle-container { + description + "Controls PM throttling."; + container throttle { + must 'suppression-interval >= measure-interval' { + error-message "'suppression-interval' cannot be less than " + + "'measure-interval'."; + description + "Constraint on 'suppression-interval' and + 'measure-interval'."; + } + description + "Link performance information in real time."; + reference + "RFC 7471: OSPF Traffic Engineering (TE) Metric Extensions + RFC 7823: Performance-Based Path Selection for Explicitly + Routed Label Switched Paths (LSPs) Using TE Metric + Extensions + RFC 8570: IS-IS Traffic Engineering (TE) Metric Extensions"; + leaf one-way-delay-offset { + type uint32 { + range "0..16777215"; + } + default "0"; + description + "Offset value to be added to the measured delay value."; + } + leaf measure-interval { + type uint32; + default "30"; + description + "Interval, in seconds, to measure the extended metric + values."; + } + leaf advertisement-interval { + type uint32; + default "0"; + description + "Interval, in seconds, to advertise the extended metric + values."; + } + leaf suppression-interval { + type uint32 { + range "1..max"; + } + default "120"; + description + "Interval, in seconds, to suppress advertisement of the + extended metric values."; + reference + "RFC 8570: IS-IS Traffic Engineering (TE) Metric + Extensions, Section 6"; + } + container threshold-out { + uses performance-metrics-thresholds; + description + "If the measured parameter falls outside an upper bound + for all but the minimum-delay metric (or a lower bound + for the minimum-delay metric only) and the advertised + value is not already outside that bound, an 'anomalous' + announcement (anomalous bit set) will be triggered."; + } + container threshold-in { + uses performance-metrics-thresholds; + description + "If the measured parameter falls inside an upper bound + for all but the minimum-delay metric (or a lower bound + for the minimum-delay metric only) and the advertised + value is not already inside that bound, a 'normal' + announcement (anomalous bit cleared) will be triggered."; + } + container threshold-accelerated-advertisement { + description + "When the difference between the last advertised value and + the current measured value exceeds this threshold, an + 'anomalous' announcement (anomalous bit set) will be + triggered."; + uses performance-metrics-thresholds; + } + } + } + + /** + * TE tunnel generic groupings + **/ + + grouping explicit-route-hop { + description + "The explicit route entry grouping."; + choice type { + description + "The explicit route entry type."; + case numbered-node-hop { + container numbered-node-hop { + leaf node-id { + type te-node-id; + mandatory true; + description + "The identifier of a node in the TE topology."; + } + leaf hop-type { + type te-hop-type; + default "strict"; + description + "Strict or loose hop."; + } + description + "Numbered node route hop."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels, + Section 4.3, EXPLICIT_ROUTE in RSVP-TE + RFC 3477: Signalling Unnumbered Links in Resource + ReSerVation Protocol - Traffic Engineering (RSVP-TE)"; + } + } + case numbered-link-hop { + container numbered-link-hop { + leaf link-tp-id { + type te-tp-id; + mandatory true; + description + "TE Link Termination Point (LTP) identifier."; + } + leaf hop-type { + type te-hop-type; + default "strict"; + description + "Strict or loose hop."; + } + leaf direction { + type te-link-direction; + default "outgoing"; + description + "Link route object direction."; + } + description + "Numbered link explicit route hop."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels, + Section 4.3, EXPLICIT_ROUTE in RSVP-TE + RFC 3477: Signalling Unnumbered Links in Resource + ReSerVation Protocol - Traffic Engineering (RSVP-TE)"; + } + } + case unnumbered-link-hop { + container unnumbered-link-hop { + leaf link-tp-id { + type te-tp-id; + mandatory true; + description + "TE LTP identifier. The combination of the TE link ID + and the TE node ID is used to identify an unnumbered + TE link."; + } + leaf node-id { + type te-node-id; + mandatory true; + description + "The identifier of a node in the TE topology."; + } + leaf hop-type { + type te-hop-type; + default "strict"; + description + "Strict or loose hop."; + } + leaf direction { + type te-link-direction; + default "outgoing"; + description + "Link route object direction."; + } + description + "Unnumbered link explicit route hop."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels, + Section 4.3, EXPLICIT_ROUTE in RSVP-TE + RFC 3477: Signalling Unnumbered Links in Resource + ReSerVation Protocol - Traffic Engineering (RSVP-TE)"; + } + } + case as-number { + container as-number-hop { + leaf as-number { + type inet:as-number; + mandatory true; + description + "The Autonomous System (AS) number."; + } + leaf hop-type { + type te-hop-type; + default "strict"; + description + "Strict or loose hop."; + } + description + "AS explicit route hop."; + } + } + case label { + container label-hop { + description + "Label hop type."; + uses te-label; + } + description + "The label explicit route hop type."; + } + } + } + + grouping record-route-state { + description + "The Record Route grouping."; + leaf index { + type uint32; + description + "Record Route hop index. The index is used to + identify an entry in the list. The order of entries + is defined by the user without relying on key values."; + } + choice type { + description + "The Record Route entry type."; + case numbered-node-hop { + container numbered-node-hop { + description + "Numbered node route hop container."; + leaf node-id { + type te-node-id; + mandatory true; + description + "The identifier of a node in the TE topology."; + } + leaf-list flags { + type path-attribute-flags; + description + "Path attributes flags."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels + RFC 4090: Fast Reroute Extensions to RSVP-TE for LSP + Tunnels + RFC 4561: Definition of a Record Route Object (RRO) + Node-Id Sub-Object"; + } + } + description + "Numbered node route hop."; + } + case numbered-link-hop { + container numbered-link-hop { + description + "Numbered link route hop container."; + leaf link-tp-id { + type te-tp-id; + mandatory true; + description + "Numbered TE LTP identifier."; + } + leaf-list flags { + type path-attribute-flags; + description + "Path attributes flags."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels + RFC 4090: Fast Reroute Extensions to RSVP-TE for LSP + Tunnels + RFC 4561: Definition of a Record Route Object (RRO) + Node-Id Sub-Object"; + } + } + description + "Numbered link route hop."; + } + case unnumbered-link-hop { + container unnumbered-link-hop { + leaf link-tp-id { + type te-tp-id; + mandatory true; + description + "TE LTP identifier. The combination of the TE link ID + and the TE node ID is used to identify an unnumbered + TE link."; + } + leaf node-id { + type te-node-id; + description + "The identifier of a node in the TE topology."; + } + leaf-list flags { + type path-attribute-flags; + description + "Path attributes flags."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels + RFC 4090: Fast Reroute Extensions to RSVP-TE for LSP + Tunnels + RFC 4561: Definition of a Record Route Object (RRO) + Node-Id Sub-Object"; + } + description + "Unnumbered link Record Route hop."; + reference + "RFC 3477: Signalling Unnumbered Links in Resource + ReSerVation Protocol - Traffic Engineering (RSVP-TE)"; + } + description + "Unnumbered link route hop."; + } + case label { + container label-hop { + description + "Label route hop type."; + uses te-label; + leaf-list flags { + type path-attribute-flags; + description + "Path attributes flags."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels + RFC 4090: Fast Reroute Extensions to RSVP-TE for LSP + Tunnels + RFC 4561: Definition of a Record Route Object (RRO) + Node-Id Sub-Object"; + } + } + description + "The label Record Route entry types."; + } + } + } + + grouping label-restriction-info { + description + "Label set item information."; + leaf restriction { + type enumeration { + enum inclusive { + description + "The label or label range is inclusive."; + } + enum exclusive { + description + "The label or label range is exclusive."; + } + } + default "inclusive"; + description + "Indicates whether the list item is inclusive or exclusive."; + } + leaf index { + type uint32; + description + "The index of the label restriction list entry."; + } + container label-start { + must "(not(../label-end/te-label/direction) and" + + " not(te-label/direction))" + + " or " + + "(../label-end/te-label/direction = te-label/direction)" + + " or " + + "(not(te-label/direction) and" + + " (../label-end/te-label/direction = 'forward'))" + + " or " + + "(not(../label-end/te-label/direction) and" + + " (te-label/direction = 'forward'))" { + error-message "'label-start' and 'label-end' must have the " + + "same direction."; + } + description + "This is the starting label if a label range is specified. + This is the label value if a single label is specified, + in which case the 'label-end' attribute is not set."; + uses te-label; + } + container label-end { + must "(not(../label-start/te-label/direction) and" + + " not(te-label/direction))" + + " or " + + "(../label-start/te-label/direction = te-label/direction)" + + " or " + + "(not(te-label/direction) and" + + " (../label-start/te-label/direction = 'forward'))" + + " or " + + "(not(../label-start/te-label/direction) and" + + " (te-label/direction = 'forward'))" { + error-message "'label-start' and 'label-end' must have the " + + "same direction."; + } + description + "This is the ending label if a label range is specified. + This attribute is not set if a single label is specified."; + uses te-label; + } + container label-step { + description + "The step increment between labels in the label range. + The label start/end values will have to be consistent + with the sign of label step. For example, + 'label-start' < 'label-end' enforces 'label-step' > 0 + 'label-start' > 'label-end' enforces 'label-step' < 0."; + choice technology { + default "generic"; + description + "Data-plane technology type."; + case generic { + leaf generic { + type int32; + default "1"; + description + "Label range step."; + } + } + } + } + leaf range-bitmap { + type yang:hex-string; + description + "When there are gaps between 'label-start' and 'label-end', + this attribute is used to specify the positions + of the used labels. This is represented in big endian as + 'hex-string'. + The most significant byte in the hex-string is the farthest + to the left in the byte sequence. Leading zero bytes in the + configured value may be omitted for brevity. + Each bit position in the 'range-bitmap' 'hex-string' maps + to a label in the range derived from 'label-start'. + + For example, assuming that 'label-start' = 16000 and + 'range-bitmap' = 0x01000001, then: + + - bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. + - bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1."; + } + } + + grouping label-set-info { + description + "Grouping for the list of label restrictions specifying what + labels may or may not be used."; + container label-restrictions { + description + "The label restrictions container."; + list label-restriction { + key "index"; + description + "The absence of the label restrictions container implies + that all labels are acceptable; otherwise, only restricted + labels are available."; + reference + "RFC 7579: General Network Element Constraint Encoding + for GMPLS-Controlled Networks"; + uses label-restriction-info; + } + } + } + + grouping optimization-metric-entry { + description + "Optimization metrics configuration grouping."; + leaf metric-type { + type identityref { + base path-metric-type; + } + description + "Identifies the 'metric-type' that the path computation + process uses for optimization."; + } + leaf weight { + type uint8; + default "1"; + description + "TE path metric normalization weight."; + } + container explicit-route-exclude-objects { + when "../metric-type = " + + "'te-types:path-metric-optimize-excludes'"; + description + "Container for the 'exclude route' object list."; + uses path-route-exclude-objects; + } + container explicit-route-include-objects { + when "../metric-type = " + + "'te-types:path-metric-optimize-includes'"; + description + "Container for the 'include route' object list."; + uses path-route-include-objects; + } + } + + grouping common-constraints { + description + "Common constraints grouping that can be set on + a constraint set or directly on the tunnel."; + uses te-bandwidth { + description + "A requested bandwidth to use for path computation."; + } + leaf link-protection { + type identityref { + base link-protection-type; + } + default "te-types:link-protection-unprotected"; + description + "Link protection type required for the links included + in the computed path."; + reference + "RFC 4202: Routing Extensions in Support of + Generalized Multi-Protocol Label Switching (GMPLS)"; + } + leaf setup-priority { + type uint8 { + range "0..7"; + } + default "7"; + description + "TE LSP requested setup priority."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels"; + } + leaf hold-priority { + type uint8 { + range "0..7"; + } + default "7"; + description + "TE LSP requested hold priority."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels"; + } + leaf signaling-type { + type identityref { + base path-signaling-type; + } + default "te-types:path-setup-rsvp"; + description + "TE tunnel path signaling type."; + } + } + + grouping tunnel-constraints { + description + "Tunnel constraints grouping that can be set on + a constraint set or directly on the tunnel."; + uses te-topology-identifier; + uses common-constraints; + } + + grouping path-constraints-route-objects { + description + "List of route entries to be included or excluded when + performing the path computation."; + container explicit-route-objects-always { + description + "Container for the 'exclude route' object list."; + list route-object-exclude-always { + key "index"; + ordered-by user; + description + "List of route objects to always exclude from the path + computation."; + leaf index { + type uint32; + description + "Explicit Route Object index. The index is used to + identify an entry in the list. The order of entries + is defined by the user without relying on key values."; + } + uses explicit-route-hop; + } + list route-object-include-exclude { + key "index"; + ordered-by user; + description + "List of route objects to include or exclude in the path + computation."; + leaf explicit-route-usage { + type identityref { + base route-usage-type; + } + default "te-types:route-include-object"; + description + "Indicates whether to include or exclude the + route object. The default is to include it."; + } + leaf index { + type uint32; + description + "Route object include-exclude index. The index is used + to identify an entry in the list. The order of entries + is defined by the user without relying on key values."; + } + uses explicit-route-hop { + augment "type" { + case srlg { + container srlg { + description + "SRLG container."; + leaf srlg { + type uint32; + description + "SRLG value."; + } + } + description + "An SRLG value to be included or excluded."; + } + description + "Augmentation for a generic explicit route for SRLG + exclusion."; + } + } + } + } + } + + grouping path-route-include-objects { + description + "List of route objects to be included when performing + the path computation."; + list route-object-include-object { + key "index"; + ordered-by user; + description + "List of Explicit Route Objects to be included in the + path computation."; + leaf index { + type uint32; + description + "Route object entry index. The index is used to + identify an entry in the list. The order of entries + is defined by the user without relying on key values."; + } + uses explicit-route-hop; + } + } + + grouping path-route-exclude-objects { + description + "List of route objects to be excluded when performing + the path computation."; + list route-object-exclude-object { + key "index"; + ordered-by user; + description + "List of Explicit Route Objects to be excluded in the + path computation."; + leaf index { + type uint32; + description + "Route object entry index. The index is used to + identify an entry in the list. The order of entries + is defined by the user without relying on key values."; + } + uses explicit-route-hop { + augment "type" { + case srlg { + container srlg { + description + "SRLG container."; + leaf srlg { + type uint32; + description + "SRLG value."; + } + } + description + "An SRLG value to be included or excluded."; + } + description + "Augmentation for a generic explicit route for SRLG + exclusion."; + } + } + } + } + + grouping generic-path-metric-bounds { + description + "TE path metric bounds grouping."; + container path-metric-bounds { + description + "TE path metric bounds container."; + list path-metric-bound { + key "metric-type"; + description + "List of TE path metric bounds."; + leaf metric-type { + type identityref { + base path-metric-type; + } + description + "Identifies an entry in the list of 'metric-type' items + bound for the TE path."; + } + leaf upper-bound { + type uint64; + default "0"; + description + "Upper bound on the end-to-end TE path metric. A zero + indicates an unbounded upper limit for the specific + 'metric-type'."; + } + } + } + } + + grouping generic-path-optimization { + description + "TE generic path optimization grouping."; + container optimizations { + description + "The objective function container that includes + attributes to impose when computing a TE path."; + choice algorithm { + description + "Optimizations algorithm."; + case metric { + if-feature "path-optimization-metric"; + /* Optimize by metric */ + list optimization-metric { + key "metric-type"; + description + "TE path metric type."; + uses optimization-metric-entry; + } + /* Tiebreakers */ + container tiebreakers { + description + "Container for the list of tiebreakers."; + list tiebreaker { + key "tiebreaker-type"; + description + "The list of tiebreaker criteria to apply on an + equally favored set of paths, in order to pick + the best."; + leaf tiebreaker-type { + type identityref { + base path-metric-type; + } + description + "Identifies an entry in the list of tiebreakers."; + } + } + } + } + case objective-function { + if-feature "path-optimization-objective-function"; + /* Objective functions */ + container objective-function { + description + "The objective function container that includes + attributes to impose when computing a TE path."; + leaf objective-function-type { + type identityref { + base objective-function-type; + } + default "te-types:of-minimize-cost-path"; + description + "Objective function entry."; + } + } + } + } + } + } + + grouping generic-path-affinities { + description + "Path affinities grouping."; + container path-affinities-values { + description + "Path affinities represented as values."; + list path-affinities-value { + key "usage"; + description + "List of named affinity constraints."; + leaf usage { + type identityref { + base resource-affinities-type; + } + description + "Identifies an entry in the list of value affinity + constraints."; + } + leaf value { + type admin-groups; + default ""; + description + "The affinity value. The default is empty."; + } + } + } + container path-affinity-names { + description + "Path affinities represented as names."; + list path-affinity-name { + key "usage"; + description + "List of named affinity constraints."; + leaf usage { + type identityref { + base resource-affinities-type; + } + description + "Identifies an entry in the list of named affinity + constraints."; + } + list affinity-name { + key "name"; + leaf name { + type string; + description + "Identifies a named affinity entry."; + } + description + "List of named affinities."; + } + } + } + } + + grouping generic-path-srlgs { + description + "Path SRLG grouping."; + container path-srlgs-lists { + description + "Path SRLG properties container."; + list path-srlgs-list { + key "usage"; + description + "List of SRLG values to be included or excluded."; + leaf usage { + type identityref { + base route-usage-type; + } + description + "Identifies an entry in a list of SRLGs to either + include or exclude."; + } + leaf-list values { + type srlg; + description + "List of SRLG values."; + } + } + } + container path-srlgs-names { + description + "Container for the list of named SRLGs."; + list path-srlgs-name { + key "usage"; + description + "List of named SRLGs to be included or excluded."; + leaf usage { + type identityref { + base route-usage-type; + } + description + "Identifies an entry in a list of named SRLGs to either + include or exclude."; + } + leaf-list names { + type string; + description + "List of named SRLGs."; + } + } + } + } + + grouping generic-path-disjointness { + description + "Path disjointness grouping."; + leaf disjointness { + type te-path-disjointness; + description + "The type of resource disjointness. + When configured for a primary path, the disjointness level + applies to all secondary LSPs. When configured for a + secondary path, the disjointness level overrides the level + configured for the primary path."; + } + } + + grouping common-path-constraints-attributes { + description + "Common path constraints configuration grouping."; + uses common-constraints; + uses generic-path-metric-bounds; + uses generic-path-affinities; + uses generic-path-srlgs; + } + + grouping generic-path-constraints { + description + "Global named path constraints configuration grouping."; + container path-constraints { + description + "TE named path constraints container."; + uses common-path-constraints-attributes; + uses generic-path-disjointness; + } + } + + grouping generic-path-properties { + description + "TE generic path properties grouping."; + container path-properties { + config false; + description + "The TE path properties."; + list path-metric { + key "metric-type"; + description + "TE path metric type."; + leaf metric-type { + type identityref { + base path-metric-type; + } + description + "TE path metric type."; + } + leaf accumulative-value { + type uint64; + description + "TE path metric accumulative value."; + } + } + uses generic-path-affinities; + uses generic-path-srlgs; + container path-route-objects { + description + "Container for the list of route objects either returned by + the computation engine or actually used by an LSP."; + list path-route-object { + key "index"; + ordered-by user; + description + "List of route objects either returned by the computation + engine or actually used by an LSP."; + leaf index { + type uint32; + description + "Route object entry index. The index is used to + identify an entry in the list. The order of entries + is defined by the user without relying on key + values."; + } + uses explicit-route-hop; + } + } + } + } +} diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-yang-types@2013-07-15.yang b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-yang-types@2013-07-15.yang new file mode 100644 index 000000000..956562a7b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-yang-types@2013-07-15.yang @@ -0,0 +1,475 @@ + module ietf-yang-types { + + namespace "urn:ietf:params:xml:ns:yang:ietf-yang-types"; + prefix "yang"; + + organization + "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; + + contact + "WG Web: + WG List: + + WG Chair: David Kessens + + + WG Chair: Juergen Schoenwaelder + + + Editor: Juergen Schoenwaelder + "; + + description + "This module contains a collection of generally useful derived + YANG data types. + + Copyright (c) 2013 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 6991; see + the RFC itself for full legal notices."; + + revision 2013-07-15 { + description + "This revision adds the following new data types: + - yang-identifier + - hex-string + - uuid + - dotted-quad"; + reference + "RFC 6991: Common YANG Data Types"; + } + + revision 2010-09-24 { + description + "Initial revision."; + reference + "RFC 6021: Common YANG Data Types"; + } + + /*** collection of counter and gauge types ***/ + + typedef counter32 { + type uint32; + description + "The counter32 type represents a non-negative integer + that monotonically increases until it reaches a + maximum value of 2^32-1 (4294967295 decimal), when it + wraps around and starts increasing again from zero. + + Counters have no defined 'initial' value, and thus, a + single value of a counter has (in general) no information + content. Discontinuities in the monotonically increasing + value normally occur at re-initialization of the + management system, and at other times as specified in the + description of a schema node using this type. If such + other times can occur, for example, the creation of + a schema node of type counter32 at times other than + re-initialization, then a corresponding schema node + should be defined, with an appropriate type, to indicate + the last discontinuity. + + The counter32 type should not be used for configuration + schema nodes. A default statement SHOULD NOT be used in + combination with the type counter32. + + In the value set and its semantics, this type is equivalent + to the Counter32 type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 + (SMIv2)"; + } + + typedef zero-based-counter32 { + type yang:counter32; + default "0"; + description + "The zero-based-counter32 type represents a counter32 + that has the defined 'initial' value zero. + + A schema node of this type will be set to zero (0) on creation + and will thereafter increase monotonically until it reaches + a maximum value of 2^32-1 (4294967295 decimal), when it + wraps around and starts increasing again from zero. + + Provided that an application discovers a new schema node + of this type within the minimum time to wrap, it can use the + 'initial' value as a delta. It is important for a management + station to be aware of this minimum time and the actual time + between polls, and to discard data if the actual time is too + long or there is no defined minimum time. + + In the value set and its semantics, this type is equivalent + to the ZeroBasedCounter32 textual convention of the SMIv2."; + reference + "RFC 4502: Remote Network Monitoring Management Information + Base Version 2"; + } + + typedef counter64 { + type uint64; + description + "The counter64 type represents a non-negative integer + that monotonically increases until it reaches a + maximum value of 2^64-1 (18446744073709551615 decimal), + when it wraps around and starts increasing again from zero. + + Counters have no defined 'initial' value, and thus, a + single value of a counter has (in general) no information + content. Discontinuities in the monotonically increasing + value normally occur at re-initialization of the + management system, and at other times as specified in the + description of a schema node using this type. If such + other times can occur, for example, the creation of + a schema node of type counter64 at times other than + re-initialization, then a corresponding schema node + should be defined, with an appropriate type, to indicate + the last discontinuity. + + The counter64 type should not be used for configuration + schema nodes. A default statement SHOULD NOT be used in + combination with the type counter64. + + In the value set and its semantics, this type is equivalent + to the Counter64 type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 + (SMIv2)"; + } + + typedef zero-based-counter64 { + type yang:counter64; + default "0"; + description + "The zero-based-counter64 type represents a counter64 that + has the defined 'initial' value zero. + + A schema node of this type will be set to zero (0) on creation + and will thereafter increase monotonically until it reaches + a maximum value of 2^64-1 (18446744073709551615 decimal), + when it wraps around and starts increasing again from zero. + + Provided that an application discovers a new schema node + of this type within the minimum time to wrap, it can use the + 'initial' value as a delta. It is important for a management + station to be aware of this minimum time and the actual time + between polls, and to discard data if the actual time is too + long or there is no defined minimum time. + + In the value set and its semantics, this type is equivalent + to the ZeroBasedCounter64 textual convention of the SMIv2."; + reference + "RFC 2856: Textual Conventions for Additional High Capacity + Data Types"; + } + + typedef gauge32 { + type uint32; + description + "The gauge32 type represents a non-negative integer, which + may increase or decrease, but shall never exceed a maximum + value, nor fall below a minimum value. The maximum value + cannot be greater than 2^32-1 (4294967295 decimal), and + the minimum value cannot be smaller than 0. The value of + a gauge32 has its maximum value whenever the information + being modeled is greater than or equal to its maximum + value, and has its minimum value whenever the information + being modeled is smaller than or equal to its minimum value. + If the information being modeled subsequently decreases + below (increases above) the maximum (minimum) value, the + gauge32 also decreases (increases). + + In the value set and its semantics, this type is equivalent + to the Gauge32 type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 + (SMIv2)"; + } + + typedef gauge64 { + type uint64; + description + "The gauge64 type represents a non-negative integer, which + may increase or decrease, but shall never exceed a maximum + value, nor fall below a minimum value. The maximum value + cannot be greater than 2^64-1 (18446744073709551615), and + the minimum value cannot be smaller than 0. The value of + a gauge64 has its maximum value whenever the information + being modeled is greater than or equal to its maximum + value, and has its minimum value whenever the information + being modeled is smaller than or equal to its minimum value. + If the information being modeled subsequently decreases + below (increases above) the maximum (minimum) value, the + gauge64 also decreases (increases). + + In the value set and its semantics, this type is equivalent + to the CounterBasedGauge64 SMIv2 textual convention defined + in RFC 2856"; + reference + "RFC 2856: Textual Conventions for Additional High Capacity + Data Types"; + } + + /*** collection of identifier-related types ***/ + + typedef object-identifier { + type string { + pattern '(([0-1](\.[1-3]?[0-9]))|(2\.(0|([1-9]\d*))))' + + '(\.(0|([1-9]\d*)))*'; + } + description + "The object-identifier type represents administratively + assigned names in a registration-hierarchical-name tree. + + Values of this type are denoted as a sequence of numerical + non-negative sub-identifier values. Each sub-identifier + value MUST NOT exceed 2^32-1 (4294967295). Sub-identifiers + are separated by single dots and without any intermediate + whitespace. + + The ASN.1 standard restricts the value space of the first + sub-identifier to 0, 1, or 2. Furthermore, the value space + of the second sub-identifier is restricted to the range + 0 to 39 if the first sub-identifier is 0 or 1. Finally, + the ASN.1 standard requires that an object identifier + has always at least two sub-identifiers. The pattern + captures these restrictions. + + Although the number of sub-identifiers is not limited, + module designers should realize that there may be + implementations that stick with the SMIv2 limit of 128 + sub-identifiers. + + This type is a superset of the SMIv2 OBJECT IDENTIFIER type + since it is not restricted to 128 sub-identifiers. Hence, + this type SHOULD NOT be used to represent the SMIv2 OBJECT + IDENTIFIER type; the object-identifier-128 type SHOULD be + used instead."; + reference + "ISO9834-1: Information technology -- Open Systems + Interconnection -- Procedures for the operation of OSI + Registration Authorities: General procedures and top + arcs of the ASN.1 Object Identifier tree"; + } + + typedef object-identifier-128 { + type object-identifier { + pattern '\d*(\.\d*){1,127}'; + } + description + "This type represents object-identifiers restricted to 128 + sub-identifiers. + + In the value set and its semantics, this type is equivalent + to the OBJECT IDENTIFIER type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 + (SMIv2)"; + } + + typedef yang-identifier { + type string { + length "1..max"; + pattern '[a-zA-Z_][a-zA-Z0-9\-_.]*'; + pattern '.|..|[^xX].*|.[^mM].*|..[^lL].*'; + } + description + "A YANG identifier string as defined by the 'identifier' + rule in Section 12 of RFC 6020. An identifier must + start with an alphabetic character or an underscore + followed by an arbitrary sequence of alphabetic or + numeric characters, underscores, hyphens, or dots. + + A YANG identifier MUST NOT start with any possible + combination of the lowercase or uppercase character + sequence 'xml'."; + reference + "RFC 6020: YANG - A Data Modeling Language for the Network + Configuration Protocol (NETCONF)"; + } + + /*** collection of types related to date and time***/ + + typedef date-and-time { + type string { + pattern '\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?' + + '(Z|[\+\-]\d{2}:\d{2})'; + } + description + "The date-and-time type is a profile of the ISO 8601 + standard for representation of dates and times using the + Gregorian calendar. The profile is defined by the + date-time production in Section 5.6 of RFC 3339. + + The date-and-time type is compatible with the dateTime XML + schema type with the following notable exceptions: + + (a) The date-and-time type does not allow negative years. + + (b) The date-and-time time-offset -00:00 indicates an unknown + time zone (see RFC 3339) while -00:00 and +00:00 and Z + all represent the same time zone in dateTime. + + (c) The canonical format (see below) of data-and-time values + differs from the canonical format used by the dateTime XML + schema type, which requires all times to be in UTC using + the time-offset 'Z'. + + This type is not equivalent to the DateAndTime textual + convention of the SMIv2 since RFC 3339 uses a different + separator between full-date and full-time and provides + higher resolution of time-secfrac. + + The canonical format for date-and-time values with a known time + zone uses a numeric time zone offset that is calculated using + the device's configured known offset to UTC time. A change of + the device's offset to UTC time will cause date-and-time values + to change accordingly. Such changes might happen periodically + in case a server follows automatically daylight saving time + (DST) time zone offset changes. The canonical format for + date-and-time values with an unknown time zone (usually + referring to the notion of local time) uses the time-offset + -00:00."; + reference + "RFC 3339: Date and Time on the Internet: Timestamps + RFC 2579: Textual Conventions for SMIv2 + XSD-TYPES: XML Schema Part 2: Datatypes Second Edition"; + } + + typedef timeticks { + type uint32; + description + "The timeticks type represents a non-negative integer that + represents the time, modulo 2^32 (4294967296 decimal), in + hundredths of a second between two epochs. When a schema + node is defined that uses this type, the description of + the schema node identifies both of the reference epochs. + + In the value set and its semantics, this type is equivalent + to the TimeTicks type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 + (SMIv2)"; + } + + typedef timestamp { + type yang:timeticks; + description + "The timestamp type represents the value of an associated + timeticks schema node at which a specific occurrence + happened. The specific occurrence must be defined in the + description of any schema node defined using this type. When + the specific occurrence occurred prior to the last time the + associated timeticks attribute was zero, then the timestamp + value is zero. Note that this requires all timestamp values + to be reset to zero when the value of the associated timeticks + attribute reaches 497+ days and wraps around to zero. + + The associated timeticks schema node must be specified + in the description of any schema node using this type. + + In the value set and its semantics, this type is equivalent + to the TimeStamp textual convention of the SMIv2."; + reference + "RFC 2579: Textual Conventions for SMIv2"; + } + + /*** collection of generic address types ***/ + + typedef phys-address { + type string { + pattern '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'; + } + + description + "Represents media- or physical-level addresses represented + as a sequence octets, each octet represented by two hexadecimal + numbers. Octets are separated by colons. The canonical + representation uses lowercase characters. + + In the value set and its semantics, this type is equivalent + to the PhysAddress textual convention of the SMIv2."; + reference + "RFC 2579: Textual Conventions for SMIv2"; + } + + typedef mac-address { + type string { + pattern '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'; + } + description + "The mac-address type represents an IEEE 802 MAC address. + The canonical representation uses lowercase characters. + + In the value set and its semantics, this type is equivalent + to the MacAddress textual convention of the SMIv2."; + reference + "IEEE 802: IEEE Standard for Local and Metropolitan Area + Networks: Overview and Architecture + RFC 2579: Textual Conventions for SMIv2"; + } + + /*** collection of XML-specific types ***/ + + typedef xpath1.0 { + type string; + description + "This type represents an XPATH 1.0 expression. + + When a schema node is defined that uses this type, the + description of the schema node MUST specify the XPath + context in which the XPath expression is evaluated."; + reference + "XPATH: XML Path Language (XPath) Version 1.0"; + } + + /*** collection of string types ***/ + + typedef hex-string { + type string { + pattern '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'; + } + + description + "A hexadecimal string with octets represented as hex digits + separated by colons. The canonical representation uses + lowercase characters."; + } + + typedef uuid { + type string { + pattern '[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12}'; + } + description + "A Universally Unique IDentifier in the string representation + defined in RFC 4122. The canonical representation uses + lowercase characters. + + The following is an example of a UUID in string representation: + f81d4fae-7dec-11d0-a765-00a0c91e6bf6 + "; + reference + "RFC 4122: A Universally Unique IDentifier (UUID) URN + Namespace"; + } + + typedef dotted-quad { + type string { + pattern + '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}' + + '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'; + } + description + "An unsigned 32-bit number expressed in the dotted-quad + notation, i.e., four octets written as decimal numbers + and separated with the '.' (full stop) character."; + } + } diff --git a/src/nbi/tests/Constants.py b/src/nbi/tests/Constants.py index d177a219a..d46ce2cf7 100644 --- a/src/nbi/tests/Constants.py +++ b/src/nbi/tests/Constants.py @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -WIM_USERNAME = 'admin' -WIM_PASSWORD = 'admin' +USERNAME = 'admin' +PASSWORD = 'admin' # Ref: https://osm.etsi.org/wikipub/index.php/WIM WIM_MAPPING = [ diff --git a/src/nbi/tests/PrepareTestScenario.py b/src/nbi/tests/PrepareTestScenario.py index 8a868851f..c3461da61 100644 --- a/src/nbi/tests/PrepareTestScenario.py +++ b/src/nbi/tests/PrepareTestScenario.py @@ -12,16 +12,23 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os, pytest, time +import logging, os, pytest, requests, time +from typing import Dict, List, Optional, Set, Union from common.Constants import ServiceNameEnum from common.Settings import ( - ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_HTTP, get_env_var_name, get_service_port_http) + ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_HTTP, + get_env_var_name, get_service_baseurl_http, get_service_port_http +) +from context.client.ContextClient import ContextClient from nbi.service.rest_server.RestServer import RestServer from nbi.service.rest_server.nbi_plugins.debug_api import register_debug_api from nbi.service.rest_server.nbi_plugins.ietf_l2vpn import register_ietf_l2vpn +from nbi.service.rest_server.nbi_plugins.ietf_network import register_ietf_network from nbi.tests.MockService_Dependencies import MockService_Dependencies +from service.client.ServiceClient import ServiceClient +from slice.client.SliceClient import SliceClient from tests.tools.mock_osm.MockOSM import MockOSM -from .Constants import WIM_MAPPING, WIM_USERNAME, WIM_PASSWORD +from .Constants import USERNAME, PASSWORD, WIM_MAPPING LOCAL_HOST = '127.0.0.1' MOCKSERVICE_PORT = 10000 @@ -38,10 +45,11 @@ def mock_service(): _service.stop() @pytest.fixture(scope='session') -def nbi_service_rest(mock_service): # pylint: disable=redefined-outer-name +def nbi_service_rest(mock_service : MockService_Dependencies): # pylint: disable=redefined-outer-name, unused-argument _rest_server = RestServer() register_debug_api(_rest_server) register_ietf_l2vpn(_rest_server) + register_ietf_network(_rest_server) _rest_server.start() time.sleep(1) # bring time for the server to start yield _rest_server @@ -49,6 +57,39 @@ def nbi_service_rest(mock_service): # pylint: disable=redefined-outer-name _rest_server.join() @pytest.fixture(scope='session') -def osm_wim(nbi_service_rest): # pylint: disable=redefined-outer-name +def osm_wim(nbi_service_rest : RestServer): # pylint: disable=redefined-outer-name, unused-argument wim_url = 'http://{:s}:{:d}'.format(LOCAL_HOST, NBI_SERVICE_PORT) - return MockOSM(wim_url, WIM_MAPPING, WIM_USERNAME, WIM_PASSWORD) + return MockOSM(wim_url, WIM_MAPPING, USERNAME, PASSWORD) + +@pytest.fixture(scope='session') +def context_client(mock_service : MockService_Dependencies): # pylint: disable=redefined-outer-name, unused-argument + _client = ContextClient() + yield _client + _client.close() + +@pytest.fixture(scope='session') +def service_client(mock_service : MockService_Dependencies): # pylint: disable=redefined-outer-name, unused-argument + _client = ServiceClient() + yield _client + _client.close() + +@pytest.fixture(scope='session') +def slice_client(mock_service : MockService_Dependencies): # pylint: disable=redefined-outer-name, unused-argument + _client = SliceClient() + yield _client + _client.close() + +def do_rest_request( + url : str, logger : Optional[logging.Logger] = None, timeout=10, expected_status_codes : Set[int] = {200} +) -> Union[Dict, List]: + base_url = get_service_baseurl_http(ServiceNameEnum.NBI) or '' + request_url = 'http://{:s}:{:s}@{:s}:{:d}{:s}{:s}'.format( + USERNAME, PASSWORD, LOCAL_HOST, NBI_SERVICE_PORT, str(base_url), url + ) + if logger is not None: + logger.warning('Request: GET {:s}'.format(str(request_url))) + reply = requests.get(request_url, timeout=timeout) + if logger is not None: + logger.warning('Reply: {:s}'.format(str(reply.text))) + assert reply.status_code in expected_status_codes, 'Reply failed with status code {:d}'.format(reply.status_code) + return reply.json() diff --git a/src/nbi/tests/data/descriptor-topology.json b/src/nbi/tests/data/descriptor-topology.json new file mode 100644 index 000000000..d8c6c4844 --- /dev/null +++ b/src/nbi/tests/data/descriptor-topology.json @@ -0,0 +1,201 @@ +{ + "dummy_mode": true, + "contexts": [ + {"context_id": {"context_uuid": {"uuid": "admin"}}, "name": "admin"} + ], + "topologies": [ + {"topology_id": {"topology_uuid": {"uuid": "admin"}, "context_id": {"context_uuid": {"uuid": "admin"}}}, "name": "admin"} + ], + "devices": [ + {"device_id": {"device_uuid": {"uuid": "fr1.fr"}}, "device_type": "emu-packet-router", "device_operational_status": 1, "device_drivers": [0], "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"uuid": "client:1", "type": "copper"}, {"uuid": "client:2", "type": "copper"}, {"uuid": "client:3", "type": "copper"}, + {"uuid": "be1.be", "type": "copper"}, {"uuid": "pt1.pt", "type": "copper"}, {"uuid": "uk1.uk", "type": "copper"}, + {"uuid": "es1.es", "type": "copper"}, {"uuid": "it1.it", "type": "copper"} + ]}}} + ]}}, + {"device_id": {"device_uuid": {"uuid": "be1.be"}}, "device_type": "emu-packet-router", "device_operational_status": 1, "device_drivers": [0], "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"uuid": "client:1", "type": "copper"}, {"uuid": "client:2", "type": "copper"}, {"uuid": "client:3", "type": "copper"}, + {"uuid": "de1.de", "type": "copper"}, {"uuid": "gr1.gr", "type": "copper"}, {"uuid": "uk1.uk", "type": "copper"}, + {"uuid": "fr1.fr", "type": "copper"}, {"uuid": "it1.it", "type": "copper"} + ]}}} + ]}}, + {"device_id": {"device_uuid": {"uuid": "uk1.uk"}}, "device_type": "emu-packet-router", "device_operational_status": 1, "device_drivers": [0], "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"uuid": "client:1", "type": "copper"}, {"uuid": "client:2", "type": "copper"}, {"uuid": "client:3", "type": "copper"}, + {"uuid": "de1.de", "type": "copper"}, {"uuid": "fr1.fr", "type": "copper"}, {"uuid": "be1.be", "type": "copper"}, + {"uuid": "pt1.pt", "type": "copper"} + ]}}} + ]}}, + {"device_id": {"device_uuid": {"uuid": "de1.de"}}, "device_type": "emu-packet-router", "device_operational_status": 1, "device_drivers": [0], "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"uuid": "client:1", "type": "copper"}, {"uuid": "client:2", "type": "copper"}, {"uuid": "client:3", "type": "copper"}, + {"uuid": "uk1.uk", "type": "copper"}, {"uuid": "be1.be", "type": "copper"}, {"uuid": "gr1.gr", "type": "copper"} + ]}}} + ]}}, + {"device_id": {"device_uuid": {"uuid": "pt1.pt"}}, "device_type": "emu-packet-router", "device_operational_status": 1, "device_drivers": [0], "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"uuid": "client:1", "type": "copper"}, {"uuid": "client:2", "type": "copper"}, {"uuid": "client:3", "type": "copper"}, + {"uuid": "uk1.uk", "type": "copper"}, {"uuid": "fr1.fr", "type": "copper"}, {"uuid": "es1.es", "type": "copper"} + ]}}} + ]}}, + {"device_id": {"device_uuid": {"uuid": "es1.es"}}, "device_type": "emu-packet-router", "device_operational_status": 1, "device_drivers": [0], "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"uuid": "client:1", "type": "copper"}, {"uuid": "client:2", "type": "copper"}, {"uuid": "client:3", "type": "copper"}, + {"uuid": "it1.it", "type": "copper"}, {"uuid": "fr1.fr", "type": "copper"}, {"uuid": "pt1.pt", "type": "copper"} + ]}}} + ]}}, + {"device_id": {"device_uuid": {"uuid": "it1.it"}}, "device_type": "emu-packet-router", "device_operational_status": 1, "device_drivers": [0], "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"uuid": "client:1", "type": "copper"}, {"uuid": "client:2", "type": "copper"}, {"uuid": "client:3", "type": "copper"}, + {"uuid": "es1.es", "type": "copper"}, {"uuid": "fr1.fr", "type": "copper"}, {"uuid": "be1.be", "type": "copper"}, + {"uuid": "gr1.gr", "type": "copper"} + ]}}} + ]}}, + {"device_id": {"device_uuid": {"uuid": "gr1.gr"}}, "device_type": "emu-packet-router", "device_operational_status": 1, "device_drivers": [0], "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"uuid": "client:1", "type": "copper"}, {"uuid": "client:2", "type": "copper"}, {"uuid": "client:3", "type": "copper"}, + {"uuid": "it1.it", "type": "copper"}, {"uuid": "de1.de", "type": "copper"}, {"uuid": "be1.be", "type": "copper"} + ]}}} + ]}} + ], + "links": [ + {"link_id": {"link_uuid": {"uuid": "fr1.fr_be1.be"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 4.804849}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "fr1.fr"}}, "endpoint_uuid": {"uuid": "be1.be"}}, + {"device_id": {"device_uuid": {"uuid": "be1.be"}}, "endpoint_uuid": {"uuid": "fr1.fr"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "uk1.uk_fr1.fr"}}, "attributes": {"total_capacity_gbps": 300, "used_capacity_gbps": 55.182499}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "uk1.uk"}}, "endpoint_uuid": {"uuid": "fr1.fr"}}, + {"device_id": {"device_uuid": {"uuid": "fr1.fr"}}, "endpoint_uuid": {"uuid": "uk1.uk"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "uk1.uk_de1.de"}}, "attributes": {"total_capacity_gbps": 600, "used_capacity_gbps": 199.272255}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "uk1.uk"}}, "endpoint_uuid": {"uuid": "de1.de"}}, + {"device_id": {"device_uuid": {"uuid": "de1.de"}}, "endpoint_uuid": {"uuid": "uk1.uk"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "uk1.uk_be1.be"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 14.334868}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "uk1.uk"}}, "endpoint_uuid": {"uuid": "be1.be"}}, + {"device_id": {"device_uuid": {"uuid": "be1.be"}}, "endpoint_uuid": {"uuid": "uk1.uk"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "pt1.pt_uk1.uk"}}, "attributes": {"total_capacity_gbps": 400, "used_capacity_gbps": 51.415678}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "pt1.pt"}}, "endpoint_uuid": {"uuid": "uk1.uk"}}, + {"device_id": {"device_uuid": {"uuid": "uk1.uk"}}, "endpoint_uuid": {"uuid": "pt1.pt"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "pt1.pt_fr1.fr"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 3.733925}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "pt1.pt"}}, "endpoint_uuid": {"uuid": "fr1.fr"}}, + {"device_id": {"device_uuid": {"uuid": "fr1.fr"}}, "endpoint_uuid": {"uuid": "pt1.pt"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "pt1.pt_es1.es"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 13.32428}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "pt1.pt"}}, "endpoint_uuid": {"uuid": "es1.es"}}, + {"device_id": {"device_uuid": {"uuid": "es1.es"}}, "endpoint_uuid": {"uuid": "pt1.pt"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "it1.it_gr1.gr"}}, "attributes": {"total_capacity_gbps": 800, "used_capacity_gbps": 1.593313}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "it1.it"}}, "endpoint_uuid": {"uuid": "gr1.gr"}}, + {"device_id": {"device_uuid": {"uuid": "gr1.gr"}}, "endpoint_uuid": {"uuid": "it1.it"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "it1.it_fr1.fr"}}, "attributes": {"total_capacity_gbps": 200, "used_capacity_gbps": 98.574706}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "it1.it"}}, "endpoint_uuid": {"uuid": "fr1.fr"}}, + {"device_id": {"device_uuid": {"uuid": "fr1.fr"}}, "endpoint_uuid": {"uuid": "it1.it"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "it1.it_es1.es"}}, "attributes": {"total_capacity_gbps": 300, "used_capacity_gbps": 18.97108}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "it1.it"}}, "endpoint_uuid": {"uuid": "es1.es"}}, + {"device_id": {"device_uuid": {"uuid": "es1.es"}}, "endpoint_uuid": {"uuid": "it1.it"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "it1.it_be1.be"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 10.327772}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "it1.it"}}, "endpoint_uuid": {"uuid": "be1.be"}}, + {"device_id": {"device_uuid": {"uuid": "be1.be"}}, "endpoint_uuid": {"uuid": "it1.it"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "gr1.gr_it1.it"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 7.983659}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "gr1.gr"}}, "endpoint_uuid": {"uuid": "it1.it"}}, + {"device_id": {"device_uuid": {"uuid": "it1.it"}}, "endpoint_uuid": {"uuid": "gr1.gr"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "gr1.gr_de1.de"}}, "attributes": {"total_capacity_gbps": 5000, "used_capacity_gbps": 4930.897339}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "gr1.gr"}}, "endpoint_uuid": {"uuid": "de1.de"}}, + {"device_id": {"device_uuid": {"uuid": "de1.de"}}, "endpoint_uuid": {"uuid": "gr1.gr"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "gr1.gr_be1.be"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 0.895539}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "gr1.gr"}}, "endpoint_uuid": {"uuid": "be1.be"}}, + {"device_id": {"device_uuid": {"uuid": "be1.be"}}, "endpoint_uuid": {"uuid": "gr1.gr"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "fr1.fr_uk1.uk"}}, "attributes": {"total_capacity_gbps": 200, "used_capacity_gbps": 28.144199}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "fr1.fr"}}, "endpoint_uuid": {"uuid": "uk1.uk"}}, + {"device_id": {"device_uuid": {"uuid": "uk1.uk"}}, "endpoint_uuid": {"uuid": "fr1.fr"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "fr1.fr_pt1.pt"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 1.916587}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "fr1.fr"}}, "endpoint_uuid": {"uuid": "pt1.pt"}}, + {"device_id": {"device_uuid": {"uuid": "pt1.pt"}}, "endpoint_uuid": {"uuid": "fr1.fr"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "fr1.fr_it1.it"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 3.330747}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "fr1.fr"}}, "endpoint_uuid": {"uuid": "it1.it"}}, + {"device_id": {"device_uuid": {"uuid": "it1.it"}}, "endpoint_uuid": {"uuid": "fr1.fr"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "fr1.fr_es1.es"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 96.682749}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "fr1.fr"}}, "endpoint_uuid": {"uuid": "es1.es"}}, + {"device_id": {"device_uuid": {"uuid": "es1.es"}}, "endpoint_uuid": {"uuid": "fr1.fr"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "es1.es_pt1.pt"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 5.643483}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "es1.es"}}, "endpoint_uuid": {"uuid": "pt1.pt"}}, + {"device_id": {"device_uuid": {"uuid": "pt1.pt"}}, "endpoint_uuid": {"uuid": "es1.es"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "es1.es_it1.it"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 15.353667}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "es1.es"}}, "endpoint_uuid": {"uuid": "it1.it"}}, + {"device_id": {"device_uuid": {"uuid": "it1.it"}}, "endpoint_uuid": {"uuid": "es1.es"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "es1.es_fr1.fr"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 20.517778}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "es1.es"}}, "endpoint_uuid": {"uuid": "fr1.fr"}}, + {"device_id": {"device_uuid": {"uuid": "fr1.fr"}}, "endpoint_uuid": {"uuid": "es1.es"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "de1.de_uk1.uk"}}, "attributes": {"total_capacity_gbps": 600, "used_capacity_gbps": 239.446965}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "de1.de"}}, "endpoint_uuid": {"uuid": "uk1.uk"}}, + {"device_id": {"device_uuid": {"uuid": "uk1.uk"}}, "endpoint_uuid": {"uuid": "de1.de"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "de1.de_gr1.gr"}}, "attributes": {"total_capacity_gbps": 2100, "used_capacity_gbps": 110.602237}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "de1.de"}}, "endpoint_uuid": {"uuid": "gr1.gr"}}, + {"device_id": {"device_uuid": {"uuid": "gr1.gr"}}, "endpoint_uuid": {"uuid": "de1.de"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "de1.de_be1.be"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 57.709307}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "de1.de"}}, "endpoint_uuid": {"uuid": "be1.be"}}, + {"device_id": {"device_uuid": {"uuid": "be1.be"}}, "endpoint_uuid": {"uuid": "de1.de"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "uk1.uk_pt1.pt"}}, "attributes": {"total_capacity_gbps": 800, "used_capacity_gbps": 652.70225}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "uk1.uk"}}, "endpoint_uuid": {"uuid": "pt1.pt"}}, + {"device_id": {"device_uuid": {"uuid": "pt1.pt"}}, "endpoint_uuid": {"uuid": "uk1.uk"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "be1.be_uk1.uk"}}, "attributes": {"total_capacity_gbps": 200, "used_capacity_gbps": 8.252107}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "be1.be"}}, "endpoint_uuid": {"uuid": "uk1.uk"}}, + {"device_id": {"device_uuid": {"uuid": "uk1.uk"}}, "endpoint_uuid": {"uuid": "be1.be"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "be1.be_it1.it"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 0.357069}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "be1.be"}}, "endpoint_uuid": {"uuid": "it1.it"}}, + {"device_id": {"device_uuid": {"uuid": "it1.it"}}, "endpoint_uuid": {"uuid": "be1.be"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "be1.be_de1.de"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 20.400142}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "be1.be"}}, "endpoint_uuid": {"uuid": "de1.de"}}, + {"device_id": {"device_uuid": {"uuid": "de1.de"}}, "endpoint_uuid": {"uuid": "be1.be"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "be1.be_fr1.fr"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 31.346514}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "be1.be"}}, "endpoint_uuid": {"uuid": "fr1.fr"}}, + {"device_id": {"device_uuid": {"uuid": "fr1.fr"}}, "endpoint_uuid": {"uuid": "be1.be"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "be1.be_gr1.gr"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 0.026822}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "be1.be"}}, "endpoint_uuid": {"uuid": "gr1.gr"}}, + {"device_id": {"device_uuid": {"uuid": "gr1.gr"}}, "endpoint_uuid": {"uuid": "be1.be"}} + ]} + ] +} diff --git a/src/nbi/tests/data/test-ietf-network.json b/src/nbi/tests/data/test-ietf-network.json new file mode 100644 index 000000000..37bf8e57b --- /dev/null +++ b/src/nbi/tests/data/test-ietf-network.json @@ -0,0 +1,1944 @@ +{ + "ietf-network:networks": { + "network": [ + { + "network-id": "providerId-10-clientId-0-topologyId-1", + "ietf-te-topology:te": { + "name": "Huawei-Network" + }, + "ietf-te-topology:te-topology-identifier": { + "provider-id": 10, + "client-id": 0, + "topology-id": "1" + }, + "network-types": { + "ietf-te-topology:te-topology": { + "ietf-otn-topology:otn-topology": {} + } + }, + "node": [ + { + "node-id": "10.0.10.1", + "ietf-te-topology:te-node-id": "10.0.10.1", + "ietf-network-topology:termination-point": [ + { + "tp-id": "501", + "ietf-te-topology:te-tp-id": 501, + "ietf-te-topology:te": { + "name": "1-1-1-1-1", + "admin-status": "up", + "oper-status": "up", + "ietf-otn-topology:client-svc": { + "client-facing": false + }, + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-oduk", + "switching-capability": "ietf-te-types:switching-otn", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:otn": { + "odu-type": "ietf-layer1-types:ODU4" + } + } + } + ] + } + ] + } + }, + { + "tp-id": "500", + "ietf-te-topology:te-tp-id": 500, + "ietf-te-topology:te": { + "name": "1-1-1-1-1", + "admin-status": "up", + "oper-status": "up", + "ietf-otn-topology:client-svc": { + "client-facing": false + }, + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-oduk", + "switching-capability": "ietf-te-types:switching-otn", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:otn": { + "odu-type": "ietf-layer1-types:ODU4" + } + } + } + ] + } + ] + } + } + ], + "ietf-te-topology:te": { + "oper-status": "up", + "te-node-attributes": { + "admin-status": "up", + "name": "OA" + }, + "tunnel-termination-point": [ + { + "tunnel-tp-id": "NTAx", + "admin-status": "up", + "oper-status": "up", + "encoding": "ietf-te-types:lsp-encoding-oduk", + "name": "1-1-1-1-1", + "protection-type": "ietf-te-types:lsp-protection-unprotected", + "switching-capability": "ietf-te-types:switching-otn", + "local-link-connectivities": { + "local-link-connectivity": [ + { + "is-allowed": true, + "link-tp-ref": "501" + } + ] + } + }, + { + "tunnel-tp-id": "NTAw", + "admin-status": "up", + "oper-status": "up", + "encoding": "ietf-te-types:lsp-encoding-oduk", + "name": "1-1-1-1-1", + "protection-type": "ietf-te-types:lsp-protection-unprotected", + "switching-capability": "ietf-te-types:switching-otn", + "local-link-connectivities": { + "local-link-connectivity": [ + { + "is-allowed": true, + "link-tp-ref": "500" + } + ] + } + } + ] + } + }, + { + "node-id": "10.0.20.1", + "ietf-te-topology:te-node-id": "10.0.20.1", + "ietf-network-topology:termination-point": [ + { + "tp-id": "501", + "ietf-te-topology:te-tp-id": 501, + "ietf-te-topology:te": { + "name": "1-1-1-1-1", + "admin-status": "up", + "oper-status": "up", + "ietf-otn-topology:client-svc": { + "client-facing": false + }, + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-oduk", + "switching-capability": "ietf-te-types:switching-otn", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:otn": { + "odu-type": "ietf-layer1-types:ODU4" + } + } + } + ] + } + ] + } + }, + { + "tp-id": "500", + "ietf-te-topology:te-tp-id": 500, + "ietf-te-topology:te": { + "name": "1-1-1-1-1", + "admin-status": "up", + "oper-status": "up", + "ietf-otn-topology:client-svc": { + "client-facing": false + }, + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-oduk", + "switching-capability": "ietf-te-types:switching-otn", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:otn": { + "odu-type": "ietf-layer1-types:ODU4" + } + } + } + ] + } + ] + } + } + ], + "ietf-te-topology:te": { + "oper-status": "up", + "te-node-attributes": { + "admin-status": "up", + "name": "P" + }, + "tunnel-termination-point": [ + { + "tunnel-tp-id": "NTAx", + "admin-status": "up", + "oper-status": "up", + "encoding": "ietf-te-types:lsp-encoding-oduk", + "name": "1-1-1-1-1", + "protection-type": "ietf-te-types:lsp-protection-unprotected", + "switching-capability": "ietf-te-types:switching-otn", + "local-link-connectivities": { + "local-link-connectivity": [ + { + "is-allowed": true, + "link-tp-ref": "501" + } + ] + } + }, + { + "tunnel-tp-id": "NTAw", + "admin-status": "up", + "oper-status": "up", + "encoding": "ietf-te-types:lsp-encoding-oduk", + "name": "1-1-1-1-1", + "protection-type": "ietf-te-types:lsp-protection-unprotected", + "switching-capability": "ietf-te-types:switching-otn", + "local-link-connectivities": { + "local-link-connectivity": [ + { + "is-allowed": true, + "link-tp-ref": "500" + } + ] + } + } + ] + } + }, + { + "node-id": "10.0.40.1", + "ietf-te-topology:te-node-id": "10.0.40.1", + "ietf-network-topology:termination-point": [ + { + "tp-id": "500", + "ietf-te-topology:te-tp-id": 500, + "ietf-te-topology:te": { + "name": "1-1-1-1-1", + "admin-status": "up", + "oper-status": "up", + "ietf-otn-topology:client-svc": { + "client-facing": false + }, + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-oduk", + "switching-capability": "ietf-te-types:switching-otn", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:otn": { + "odu-type": "ietf-layer1-types:ODU4" + } + } + } + ] + } + ] + } + }, + { + "tp-id": "501", + "ietf-te-topology:te-tp-id": 501, + "ietf-te-topology:te": { + "name": "1-1-1-1-1", + "admin-status": "up", + "oper-status": "up", + "ietf-otn-topology:client-svc": { + "client-facing": false + }, + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-oduk", + "switching-capability": "ietf-te-types:switching-otn", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:otn": { + "odu-type": "ietf-layer1-types:ODU4" + } + } + } + ] + } + ] + } + } + ], + "ietf-te-topology:te": { + "oper-status": "up", + "te-node-attributes": { + "admin-status": "up", + "name": "P" + }, + "tunnel-termination-point": [ + { + "tunnel-tp-id": "NTAw", + "admin-status": "up", + "oper-status": "up", + "encoding": "ietf-te-types:lsp-encoding-oduk", + "name": "1-1-1-1-1", + "protection-type": "ietf-te-types:lsp-protection-unprotected", + "switching-capability": "ietf-te-types:switching-otn", + "local-link-connectivities": { + "local-link-connectivity": [ + { + "is-allowed": true, + "link-tp-ref": "500" + } + ] + } + }, + { + "tunnel-tp-id": "NTAx", + "admin-status": "up", + "oper-status": "up", + "encoding": "ietf-te-types:lsp-encoding-oduk", + "name": "1-1-1-1-1", + "protection-type": "ietf-te-types:lsp-protection-unprotected", + "switching-capability": "ietf-te-types:switching-otn", + "local-link-connectivities": { + "local-link-connectivity": [ + { + "is-allowed": true, + "link-tp-ref": "501" + } + ] + } + } + ] + } + }, + { + "node-id": "10.0.30.1", + "ietf-te-topology:te-node-id": "10.0.30.1", + "ietf-network-topology:termination-point": [ + { + "tp-id": "500", + "ietf-te-topology:te-tp-id": 500, + "ietf-te-topology:te": { + "name": "1-1-1-1-1", + "admin-status": "up", + "oper-status": "up", + "ietf-otn-topology:client-svc": { + "client-facing": false + }, + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-oduk", + "switching-capability": "ietf-te-types:switching-otn", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:otn": { + "odu-type": "ietf-layer1-types:ODU4" + } + } + } + ] + } + ] + } + }, + { + "tp-id": "501", + "ietf-te-topology:te-tp-id": 501, + "ietf-te-topology:te": { + "name": "1-1-1-1-1", + "admin-status": "up", + "oper-status": "up", + "ietf-otn-topology:client-svc": { + "client-facing": false + }, + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-oduk", + "switching-capability": "ietf-te-types:switching-otn", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:otn": { + "odu-type": "ietf-layer1-types:ODU4" + } + } + } + ] + } + ] + } + } + ], + "ietf-te-topology:te": { + "oper-status": "up", + "te-node-attributes": { + "admin-status": "up", + "name": "OE" + }, + "tunnel-termination-point": [ + { + "tunnel-tp-id": "NTAw", + "admin-status": "up", + "oper-status": "up", + "encoding": "ietf-te-types:lsp-encoding-oduk", + "name": "1-1-1-1-1", + "protection-type": "ietf-te-types:lsp-protection-unprotected", + "switching-capability": "ietf-te-types:switching-otn", + "local-link-connectivities": { + "local-link-connectivity": [ + { + "is-allowed": true, + "link-tp-ref": "500" + } + ] + } + }, + { + "tunnel-tp-id": "NTAx", + "admin-status": "up", + "oper-status": "up", + "encoding": "ietf-te-types:lsp-encoding-oduk", + "name": "1-1-1-1-1", + "protection-type": "ietf-te-types:lsp-protection-unprotected", + "switching-capability": "ietf-te-types:switching-otn", + "local-link-connectivities": { + "local-link-connectivity": [ + { + "is-allowed": true, + "link-tp-ref": "501" + } + ] + } + } + ] + } + } + ], + "ietf-network-topology:link": [ + { + "link-id": "10.0.10.1-501", + "source": { + "source-node": "10.0.10.1", + "source-tp": "501" + }, + "destination": { + "dest-node": "10.0.20.1", + "dest-tp": "501" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.10.1-501", + "te-delay-metric": 1, + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-otn-topology:odulist": [ + { + "odu-type": "ietf-layer1-types:ODU0", + "number": 80 + } + ] + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:odulist": [ + { + "number": 80, + "odu-type": "ietf-layer1-types:ODU0" + } + ] + } + } + ] + } + } + }, + { + "link-id": "10.0.10.1-500", + "source": { + "source-node": "10.0.10.1", + "source-tp": "500" + }, + "destination": { + "dest-node": "10.0.40.1", + "dest-tp": "500" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.10.1-500", + "te-delay-metric": 1, + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-otn-topology:odulist": [ + { + "odu-type": "ietf-layer1-types:ODU0", + "number": 80 + } + ] + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:odulist": [ + { + "number": 80, + "odu-type": "ietf-layer1-types:ODU0" + } + ] + } + } + ] + } + } + }, + { + "link-id": "10.0.20.1-501", + "source": { + "source-node": "10.0.20.1", + "source-tp": "501" + }, + "destination": { + "dest-node": "10.0.10.1", + "dest-tp": "501" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.20.1-501", + "te-delay-metric": 1, + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-otn-topology:odulist": [ + { + "odu-type": "ietf-layer1-types:ODU0", + "number": 80 + } + ] + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:odulist": [ + { + "number": 80, + "odu-type": "ietf-layer1-types:ODU0" + } + ] + } + } + ] + } + } + }, + { + "link-id": "10.0.20.1-500", + "source": { + "source-node": "10.0.20.1", + "source-tp": "500" + }, + "destination": { + "dest-node": "10.0.30.1", + "dest-tp": "500" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.20.1-500", + "te-delay-metric": 1, + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-otn-topology:odulist": [ + { + "odu-type": "ietf-layer1-types:ODU0", + "number": 80 + } + ] + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:odulist": [ + { + "number": 80, + "odu-type": "ietf-layer1-types:ODU0" + } + ] + } + } + ] + } + } + }, + { + "link-id": "10.0.40.1-500", + "source": { + "source-node": "10.0.40.1", + "source-tp": "500" + }, + "destination": { + "dest-node": "10.0.10.1", + "dest-tp": "500" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.40.1-500", + "te-delay-metric": 1, + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-otn-topology:odulist": [ + { + "odu-type": "ietf-layer1-types:ODU0", + "number": 80 + } + ] + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:odulist": [ + { + "number": 80, + "odu-type": "ietf-layer1-types:ODU0" + } + ] + } + } + ] + } + } + }, + { + "link-id": "10.0.40.1-501", + "source": { + "source-node": "10.0.40.1", + "source-tp": "501" + }, + "destination": { + "dest-node": "10.0.30.1", + "dest-tp": "501" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.40.1-501", + "te-delay-metric": 1, + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-otn-topology:odulist": [ + { + "odu-type": "ietf-layer1-types:ODU0", + "number": 80 + } + ] + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:odulist": [ + { + "number": 80, + "odu-type": "ietf-layer1-types:ODU0" + } + ] + } + } + ] + } + } + }, + { + "link-id": "10.0.30.1-500", + "source": { + "source-node": "10.0.30.1", + "source-tp": "500" + }, + "destination": { + "dest-node": "10.0.20.1", + "dest-tp": "500" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.30.1-500", + "te-delay-metric": 1, + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-otn-topology:odulist": [ + { + "odu-type": "ietf-layer1-types:ODU0", + "number": 80 + } + ] + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:odulist": [ + { + "number": 80, + "odu-type": "ietf-layer1-types:ODU0" + } + ] + } + } + ] + } + } + }, + { + "link-id": "10.0.30.1-501", + "source": { + "source-node": "10.0.30.1", + "source-tp": "501" + }, + "destination": { + "dest-node": "10.0.40.1", + "dest-tp": "501" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.30.1-501", + "te-delay-metric": 1, + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-otn-topology:odulist": [ + { + "odu-type": "ietf-layer1-types:ODU0", + "number": 80 + } + ] + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:odulist": [ + { + "number": 80, + "odu-type": "ietf-layer1-types:ODU0" + } + ] + } + } + ] + } + } + } + ] + }, + { + "network-id": "providerId-10-clientId-0-topologyId-2", + "ietf-te-topology:te": { + "name": "Huawei-Network" + }, + "ietf-te-topology:te-topology-identifier": { + "provider-id": 10, + "client-id": 0, + "topology-id": "2" + }, + "network-types": { + "ietf-te-topology:te-topology": { + "ietf-eth-te-topology:eth-tran-topology": {} + } + }, + "node": [ + { + "node-id": "10.0.10.1", + "ietf-te-topology:te-node-id": "10.0.10.1", + "ietf-network-topology:termination-point": [ + { + "tp-id": "200", + "ietf-te-topology:te-tp-id": "128.32.33.254", + "ietf-eth-te-topology:eth-svc": { + "client-facing": true, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4094" + } + } + } + }, + "ietf-te-topology:te": { + "name": "endpoint:111", + "admin-status": "up", + "oper-status": "up", + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-ethernet", + "switching-capability": "ietf-te-types:switching-l2sc", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + ] + } + }, + { + "tp-id": "501", + "ietf-te-topology:te-tp-id": 501, + "ietf-eth-te-topology:eth-svc": { + "client-facing": false, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4094" + } + } + } + }, + "ietf-te-topology:te": { + "name": "endpoint:111", + "admin-status": "up", + "oper-status": "up", + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-ethernet", + "switching-capability": "ietf-te-types:switching-l2sc", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + ] + } + }, + { + "tp-id": "500", + "ietf-te-topology:te-tp-id": 500, + "ietf-eth-te-topology:eth-svc": { + "client-facing": false, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4094" + } + } + } + }, + "ietf-te-topology:te": { + "name": "endpoint:111", + "admin-status": "up", + "oper-status": "up", + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-ethernet", + "switching-capability": "ietf-te-types:switching-l2sc", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + ] + } + } + ], + "ietf-te-topology:te": { + "oper-status": "up", + "te-node-attributes": { + "admin-status": "up", + "name": "OA" + } + } + }, + { + "node-id": "10.0.20.1", + "ietf-te-topology:te-node-id": "10.0.20.1", + "ietf-network-topology:termination-point": [ + { + "tp-id": "501", + "ietf-te-topology:te-tp-id": 501, + "ietf-eth-te-topology:eth-svc": { + "client-facing": false, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4094" + } + } + } + }, + "ietf-te-topology:te": { + "name": "endpoint:111", + "admin-status": "up", + "oper-status": "up", + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-ethernet", + "switching-capability": "ietf-te-types:switching-l2sc", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + ] + } + }, + { + "tp-id": "500", + "ietf-te-topology:te-tp-id": 500, + "ietf-eth-te-topology:eth-svc": { + "client-facing": false, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4094" + } + } + } + }, + "ietf-te-topology:te": { + "name": "endpoint:111", + "admin-status": "up", + "oper-status": "up", + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-ethernet", + "switching-capability": "ietf-te-types:switching-l2sc", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + ] + } + } + ], + "ietf-te-topology:te": { + "oper-status": "up", + "te-node-attributes": { + "admin-status": "up", + "name": "P" + } + } + }, + { + "node-id": "10.0.40.1", + "ietf-te-topology:te-node-id": "10.0.40.1", + "ietf-network-topology:termination-point": [ + { + "tp-id": "501", + "ietf-te-topology:te-tp-id": 501, + "ietf-eth-te-topology:eth-svc": { + "client-facing": false, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4094" + } + } + } + }, + "ietf-te-topology:te": { + "name": "endpoint:111", + "admin-status": "up", + "oper-status": "up", + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-ethernet", + "switching-capability": "ietf-te-types:switching-l2sc", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + ] + } + }, + { + "tp-id": "500", + "ietf-te-topology:te-tp-id": 500, + "ietf-eth-te-topology:eth-svc": { + "client-facing": false, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4094" + } + } + } + }, + "ietf-te-topology:te": { + "name": "endpoint:111", + "admin-status": "up", + "oper-status": "up", + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-ethernet", + "switching-capability": "ietf-te-types:switching-l2sc", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + ] + } + } + ], + "ietf-te-topology:te": { + "oper-status": "up", + "te-node-attributes": { + "admin-status": "up", + "name": "P" + } + } + }, + { + "node-id": "10.0.30.1", + "ietf-te-topology:te-node-id": "10.0.30.1", + "ietf-network-topology:termination-point": [ + { + "tp-id": "200", + "ietf-te-topology:te-tp-id": "172.10.33.254", + "ietf-eth-te-topology:eth-svc": { + "client-facing": true, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4094" + } + } + } + }, + "ietf-te-topology:te": { + "name": "endpoint:111", + "admin-status": "up", + "oper-status": "up", + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-ethernet", + "switching-capability": "ietf-te-types:switching-l2sc", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + ] + } + }, + { + "tp-id": "501", + "ietf-te-topology:te-tp-id": 501, + "ietf-eth-te-topology:eth-svc": { + "client-facing": false, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4094" + } + } + } + }, + "ietf-te-topology:te": { + "name": "endpoint:111", + "admin-status": "up", + "oper-status": "up", + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-ethernet", + "switching-capability": "ietf-te-types:switching-l2sc", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + ] + } + }, + { + "tp-id": "500", + "ietf-te-topology:te-tp-id": 500, + "ietf-eth-te-topology:eth-svc": { + "client-facing": false, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4094" + } + } + } + }, + "ietf-te-topology:te": { + "name": "endpoint:111", + "admin-status": "up", + "oper-status": "up", + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-ethernet", + "switching-capability": "ietf-te-types:switching-l2sc", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + ] + } + } + ], + "ietf-te-topology:te": { + "oper-status": "up", + "te-node-attributes": { + "admin-status": "up", + "name": "OE" + } + } + }, + { + "node-id": "128.32.33.5", + "ietf-te-topology:te-node-id": "128.32.33.5", + "ietf-network-topology:termination-point": [ + { + "tp-id": "500", + "ietf-te-topology:te-tp-id": "128.32.33.2", + "ietf-eth-te-topology:eth-svc": { + "client-facing": false, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4094" + } + } + } + }, + "ietf-te-topology:te": { + "name": "endpoint:111", + "admin-status": "up", + "oper-status": "up", + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-ethernet", + "switching-capability": "ietf-te-types:switching-l2sc", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + ] + } + }, + { + "tp-id": "200", + "ietf-te-topology:te-tp-id": 200, + "ietf-eth-te-topology:eth-svc": { + "client-facing": true, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4096" + } + } + } + } + }, + { + "tp-id": "201", + "ietf-te-topology:te-tp-id": 201, + "ietf-eth-te-topology:eth-svc": { + "client-facing": true, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4096" + } + } + } + } + } + ], + "ietf-te-topology:te": { + "oper-status": "up", + "te-node-attributes": { + "admin-status": "up", + "name": "OLT", + "connectivity-matrices": { + "label-restrctions": { + "label-restrction": [ + { + "label-start": { + "te-label": { + "technology": { + "ietf-eth-te-topology:eth": { + "vlanid": 21 + } + } + } + }, + "label-end": { + "te-label": { + "technology": { + "ietf-eth-te-topology:eth": { + "vlanid": 21 + } + } + } + } + }, + { + "label-start": { + "te-label": { + "technology": { + "ietf-eth-te-topology:eth": { + "vlanid": 31 + } + } + } + }, + "label-end": { + "te-label": { + "technology": { + "ietf-eth-te-topology:eth": { + "vlanid": 31 + } + } + } + } + } + ] + } + } + } + } + }, + { + "node-id": "128.32.10.1", + "ietf-te-topology:te-node-id": "128.32.10.1", + "ietf-network-topology:termination-point": [ + { + "tp-id": "500", + "ietf-te-topology:te-tp-id": 500, + "ietf-eth-te-topology:eth-svc": { + "client-facing": false, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4094" + } + } + } + } + }, + { + "tp-id": "200", + "ietf-te-topology:te-tp-id": 200, + "ietf-eth-te-topology:eth-svc": { + "client-facing": true, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4096" + } + } + } + } + } + ], + "ietf-te-topology:te": { + "oper-status": "up", + "te-node-attributes": { + "admin-status": "up", + "name": "ONT1" + } + } + }, + { + "node-id": "128.32.20.1", + "ietf-te-topology:te-node-id": "128.32.20.1", + "ietf-network-topology:termination-point": [ + { + "tp-id": "500", + "ietf-te-topology:te-tp-id": 500, + "ietf-eth-te-topology:eth-svc": { + "client-facing": false, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4094" + } + } + } + } + }, + { + "tp-id": "200", + "ietf-te-topology:te-tp-id": 200, + "ietf-eth-te-topology:eth-svc": { + "client-facing": true, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4096" + } + } + } + } + } + ], + "ietf-te-topology:te": { + "oper-status": "up", + "te-node-attributes": { + "admin-status": "up", + "name": "ONT2" + } + } + } + ], + "ietf-network-topology:link": [ + { + "link-id": "10.0.10.1-200", + "source": { + "source-node": "10.0.10.1", + "source-tp": "200" + }, + "destination": { + "dest-node": "128.32.33.5", + "dest-tp": "500" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.10.1-200", + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + } + }, + { + "link-id": "128.32.33.5-500", + "source": { + "source-node": "128.32.33.5", + "source-tp": "500" + }, + "destination": { + "dest-node": "10.0.10.1", + "dest-tp": "200" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "128.32.33.5-500", + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + } + }, + { + "link-id": "10.0.10.1-501", + "source": { + "source-node": "10.0.10.1", + "source-tp": "501" + }, + "destination": { + "dest-node": "10.0.20.1", + "dest-tp": "501" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.10.1-501", + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + } + }, + { + "link-id": "10.0.10.1-500", + "source": { + "source-node": "10.0.10.1", + "source-tp": "500" + }, + "destination": { + "dest-node": "10.0.40.1", + "dest-tp": "500" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.10.1-500", + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + } + }, + { + "link-id": "10.0.20.1-501", + "source": { + "source-node": "10.0.20.1", + "source-tp": "501" + }, + "destination": { + "dest-node": "10.0.10.1", + "dest-tp": "501" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.20.1-501", + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + } + }, + { + "link-id": "10.0.20.1-500", + "source": { + "source-node": "10.0.20.1", + "source-tp": "500" + }, + "destination": { + "dest-node": "10.0.30.1", + "dest-tp": "500" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.20.1-500", + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + } + }, + { + "link-id": "10.0.40.1-501", + "source": { + "source-node": "10.0.40.1", + "source-tp": "501" + }, + "destination": { + "dest-node": "10.0.30.1", + "dest-tp": "501" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.40.1-501", + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + } + }, + { + "link-id": "10.0.40.1-500", + "source": { + "source-node": "10.0.40.1", + "source-tp": "500" + }, + "destination": { + "dest-node": "10.0.10.1", + "dest-tp": "500" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.40.1-500", + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + } + }, + { + "link-id": "10.0.30.1-501", + "source": { + "source-node": "10.0.30.1", + "source-tp": "501" + }, + "destination": { + "dest-node": "10.0.40.1", + "dest-tp": "501" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.30.1-501", + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + } + }, + { + "link-id": "10.0.30.1-500", + "source": { + "source-node": "10.0.0.1", + "source-tp": "500" + }, + "destination": { + "dest-node": "10.0.20.1", + "dest-tp": "500" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.30.1-500", + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + } + }, + { + "link-id": "128.32.33.5-200", + "source": { + "source-node": "128.32.33.5", + "source-tp": "200" + }, + "destination": { + "dest-node": "128.32.10.1", + "dest-tp": "500" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "128.32.33.5-200", + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + } + }, + { + "link-id": "128.32.10.1-500", + "source": { + "source-node": "128.32.10.1", + "source-tp": "500" + }, + "destination": { + "dest-node": "128.32.33.5", + "dest-tp": "200" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "128.32.10.1-500", + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + } + }, + { + "link-id": "128.32.33.5-201", + "source": { + "source-node": "128.32.33.5", + "source-tp": "201" + }, + "destination": { + "dest-node": "128.32.20.1", + "dest-tp": "500" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "128.32.33.5-201", + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + } + }, + { + "link-id": "128.32.20.1-500", + "source": { + "source-node": "128.32.20.1", + "source-tp": "500" + }, + "destination": { + "dest-node": "128.32.33.5", + "dest-tp": "201" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "128.32.20.15-500", + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + } + } + ] + } + ] + } +} diff --git a/src/nbi/tests/test_ietf_network.py b/src/nbi/tests/test_ietf_network.py new file mode 100644 index 000000000..691dbc0db --- /dev/null +++ b/src/nbi/tests/test_ietf_network.py @@ -0,0 +1,70 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + +import deepdiff, json, logging +from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME +from common.proto.context_pb2 import ContextId, TopologyId +from common.tools.descriptor.Loader import DescriptorLoader, check_descriptor_load_results, validate_empty_scenario +from common.tools.object_factory.Context import json_context_id +from common.tools.object_factory.Topology import json_topology_id +from context.client.ContextClient import ContextClient +from nbi.service.rest_server import RestServer +from .PrepareTestScenario import ( # pylint: disable=unused-import + # be careful, order of symbols is important here! + do_rest_request, mock_service, nbi_service_rest, osm_wim, context_client) + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +DESCRIPTOR_FILE = 'nbi/tests/data/descriptor-topology.json' +TARGET_DATA_FILE = 'nbi/tests/data/test-ietf-network.json' + +JSON_ADMIN_CONTEXT_ID = json_context_id(DEFAULT_CONTEXT_NAME) +ADMIN_CONTEXT_ID = ContextId(**JSON_ADMIN_CONTEXT_ID) +ADMIN_TOPOLOGY_ID = TopologyId(**json_topology_id(DEFAULT_TOPOLOGY_NAME, context_id=JSON_ADMIN_CONTEXT_ID)) + +def test_prepare_environment(context_client : ContextClient) -> None: # pylint: disable=redefined-outer-name + validate_empty_scenario(context_client) + descriptor_loader = DescriptorLoader(descriptors_file=DESCRIPTOR_FILE, context_client=context_client) + results = descriptor_loader.process() + check_descriptor_load_results(results, descriptor_loader) + descriptor_loader.validate() + + # Verify the scenario has no services/slices + response = context_client.GetContext(ADMIN_CONTEXT_ID) + assert len(response.topology_ids) == 1 + assert len(response.service_ids ) == 0 + assert len(response.slice_ids ) == 0 + +def test_rest_get_networks(nbi_service_rest : RestServer): # pylint: disable=redefined-outer-name, unused-argument + with open(TARGET_DATA_FILE, 'r', encoding='UTF-8') as f: + target_data = json.load(f) + URL = '/restconf/data/ietf-network:networks' + retieved_data = do_rest_request(URL, logger=LOGGER, expected_status_codes={200}) + diff_data = deepdiff.DeepDiff(target_data, retieved_data) + LOGGER.error('Differences:\n{:s}'.format(str(diff_data.pretty()))) + assert len(diff_data) == 0 + +def test_cleanup_environment(context_client : ContextClient) -> None: # pylint: disable=redefined-outer-name + # Verify the scenario has no services/slices + response = context_client.GetContext(ADMIN_CONTEXT_ID) + assert len(response.topology_ids) == 1 + assert len(response.service_ids ) == 0 + assert len(response.slice_ids ) == 0 + + # Load descriptors and validate the base scenario + descriptor_loader = DescriptorLoader(descriptors_file=DESCRIPTOR_FILE, context_client=context_client) + descriptor_loader.validate() + descriptor_loader.unload() + validate_empty_scenario(context_client) -- GitLab From 7f99c921c3b3e6c42eda786939ba021f2654ebe8 Mon Sep 17 00:00:00 2001 From: gifrerenom Date: Wed, 13 Dec 2023 18:34:16 +0000 Subject: [PATCH 02/16] Common - Tools - Context Queries: - Corrected Type Hint in method get_topology_details() --- src/common/tools/context_queries/Topology.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/tools/context_queries/Topology.py b/src/common/tools/context_queries/Topology.py index caf03ed0e..c90d59105 100644 --- a/src/common/tools/context_queries/Topology.py +++ b/src/common/tools/context_queries/Topology.py @@ -65,7 +65,7 @@ def get_topology( def get_topology_details( context_client : ContextClient, topology_uuid : str, context_uuid : str = DEFAULT_CONTEXT_NAME, rw_copy : bool = False - ) -> Optional[Topology]: + ) -> Optional[TopologyDetails]: try: # pylint: disable=no-member topology_id = TopologyId() -- GitLab From 997275a7bb63363374e1a8ae77f7c7d224aebfac Mon Sep 17 00:00:00 2001 From: gifrerenom Date: Wed, 13 Dec 2023 18:37:27 +0000 Subject: [PATCH 03/16] NBI Component - IETF Network plugin: - Extended implementation of get network method - Added sort_data() method to properly compare in unitary test - Corrected test case descriptors - Added missing Python requirements --- src/nbi/requirements.in | 4 +- .../nbi_plugins/ietf_network/Networks.py | 112 +++++- src/nbi/tests/data/descriptor-topology.json | 201 ----------- src/nbi/tests/data/topology-real.json | 123 +++++++ src/nbi/tests/data/topology_dummy.json | 335 ++++++++++++++++++ src/nbi/tests/test_ietf_network.py | 41 ++- 6 files changed, 589 insertions(+), 227 deletions(-) delete mode 100644 src/nbi/tests/data/descriptor-topology.json create mode 100644 src/nbi/tests/data/topology-real.json create mode 100644 src/nbi/tests/data/topology_dummy.json diff --git a/src/nbi/requirements.in b/src/nbi/requirements.in index 63f39a3cf..69978edc0 100644 --- a/src/nbi/requirements.in +++ b/src/nbi/requirements.in @@ -17,5 +17,7 @@ Flask==2.1.3 Flask-HTTPAuth==4.5.0 Flask-RESTful==0.3.9 jsonschema==4.4.0 +pyang +git+https://github.com/robshakir/pyangbind.git requests==2.27.1 -werkzeug==2.3.7 \ No newline at end of file +werkzeug==2.3.7 diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/Networks.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/Networks.py index a46f13f3f..c5675f17a 100644 --- a/src/nbi/service/rest_server/nbi_plugins/ietf_network/Networks.py +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/Networks.py @@ -12,20 +12,28 @@ # See the License for the specific language governing permissions and # limitations under the License. -import json, logging +import json, logging, re +from typing import Dict, Tuple from flask import request from flask.json import jsonify from flask_restful import Resource #from common.tools.context_queries.Slice import get_slice_by_uuid import pyangbind.lib.pybindJSON as pybindJSON +from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME +from common.proto.context_pb2 import ContextId +from common.tools.context_queries.Topology import get_topology_details +from common.tools.object_factory.Context import json_context_id from context.client.ContextClient import ContextClient from nbi.service.rest_server.nbi_plugins.ietf_network.Constants import CLIENT_ID, PROVIDER_ID from nbi.service.rest_server.nbi_plugins.tools.Authentication import HTTP_AUTH from nbi.service.rest_server.nbi_plugins.tools.HttpStatusCodes import HTTP_OK, HTTP_SERVERERROR -from .bindings import ietf_network, ietf_otn_topology +from .bindings import ietf_network LOGGER = logging.getLogger(__name__) +ADMIN_CONTEXT_UUIDS = {DEFAULT_CONTEXT_NAME} +ADMIN_TOPOLOGY_UUIDS = {DEFAULT_TOPOLOGY_NAME} + class Networks(Resource): @HTTP_AUTH.login_required def get(self): @@ -37,29 +45,95 @@ class Networks(Resource): #if target is None: # raise Exception('VPN({:s}) not found in database'.format(str(vpn_id))) - ietf_net = ietf_network() + ietf_nets = ietf_network() + + topology_ids = context_client.ListTopologyIds(ContextId(**json_context_id(DEFAULT_CONTEXT_NAME))) + for topology_id in topology_ids.topology_ids: + context_uuid = topology_id.context_id.context_uuid.uuid + topology_uuid = topology_id.topology_uuid.uuid + if context_uuid in ADMIN_CONTEXT_UUIDS and topology_uuid in ADMIN_TOPOLOGY_UUIDS: continue + + topology_details = get_topology_details( + context_client, topology_uuid, context_uuid=context_uuid, rw_copy=True + ) + if topology_details is None: + MSG = 'Topology({:s}/{:s}) not found' + LOGGER.warning(MSG.format(context_uuid, topology_uuid)) + continue + + topology_name = topology_details.name + ietf_net = ietf_nets.networks.network.add(topology_name) + ietf_net.te.name = 'Huawei-Network' + + match = re.match(r'providerId\-([^\-]*)-clientId-([^\-]*)-topologyId-([^\-]*)', topology_name) + if match is not None: + provider_id, client_id, topology_id = match.groups() + ietf_net.te_topology_identifier.provider_id = int(provider_id) + ietf_net.te_topology_identifier.client_id = int(client_id) + ietf_net.te_topology_identifier.topology_id = str(topology_id) + + ietf_net.network_types.te_topology._set_present() + # TODO: resolve setting of otn_topology/eth_tran_topology network type; not working in bindings. + # See below. + # ietf_net.network_types.te_topology.otn_topology._set_present() + # ietf_net.network_types.te_topology.eth_tran_topology._set_present() + + device_uuid_to_name : Dict[str, str] = dict() + endpoint_uuid_to_name : Dict[Tuple[str, str], str] = dict() + for device in topology_details.devices: + device_uuid = device.device_id.device_uuid.uuid + device_name = device.name + device_uuid_to_name[device_uuid] = device_name + device_uuid_to_name[device_name] = device_name + ietf_node = ietf_net.node.add(device_name) + ietf_node.te_node_id = device_name - ietf_otn = ietf_otn_topology() - ietf_otn. + for endpoint in device.device_endpoints: + endpoint_uuid = endpoint.endpoint_id.endpoint_uuid.uuid + endpoint_name = endpoint.name + if endpoint_name == 'mgmt': continue + endpoint_uuid_to_name[(device_uuid, endpoint_uuid)] = endpoint_name + endpoint_uuid_to_name[(device_name, endpoint_uuid)] = endpoint_name + endpoint_uuid_to_name[(device_uuid, endpoint_name)] = endpoint_name + endpoint_uuid_to_name[(device_name, endpoint_name)] = endpoint_name + ietf_node.termination_point.add(endpoint_name) - net1 = ietf_net.networks.network.add('providerId-10-clientId-0-topologyId-1') - net1.te.name = 'Huawei-Network' - net1.te_topology_identifier.provider_id = PROVIDER_ID - net1.te_topology_identifier.client_id = CLIENT_ID - net1.te_topology_identifier.topology_id = '1' - net1.network_types.te_topology._set_presence() - net1.network_types.te_topology.otn_topology._set_presence() + for link in topology_details.links: + link_name = link.name + ietf_link = ietf_net.link.add(link_name) + #ietf_link.link_id = link_name + + src_dev_uuid = link.link_endpoint_ids[ 0].device_id.device_uuid.uuid + src_ep_uuid = link.link_endpoint_ids[ 0].endpoint_uuid.uuid + ietf_link.source.source_node = device_uuid_to_name.get( + src_dev_uuid, src_dev_uuid + ) + ietf_link.source.source_tp = endpoint_uuid_to_name.get( + (src_dev_uuid, src_ep_uuid), src_ep_uuid + ) - net2 = ietf_net.networks.network.add('providerId-10-clientId-0-topologyId-2') - net2.te.name = 'Huawei-Network' - net2.te_topology_identifier.provider_id = PROVIDER_ID - net2.te_topology_identifier.client_id = CLIENT_ID - net2.te_topology_identifier.topology_id = '2' + dst_dev_uuid = link.link_endpoint_ids[-1].device_id.device_uuid.uuid + dst_ep_uuid = link.link_endpoint_ids[-1].endpoint_uuid.uuid + ietf_link.destination.dest_node = device_uuid_to_name.get( + dst_dev_uuid, dst_dev_uuid + ) + ietf_link.destination.dest_tp = endpoint_uuid_to_name.get( + (dst_dev_uuid, dst_ep_uuid), dst_ep_uuid + ) + # TODO: improve these workarounds to enhance performance + json_response = json.loads(pybindJSON.dumps(ietf_nets, mode='ietf')) + # TODO: workaround to set network types manually. Currently does not work; refine bindings. + # Seems limitation of pyangbind using multiple augmentations and nested empty containers. + for json_network in json_response['ietf-network:networks']['network']: + net_te_topo_id = json_network.get('ietf-te-topology:te-topology-identifier', {}).get('topology-id') + if net_te_topo_id is None: continue + net_te_topo_type = json_network['network-types']['ietf-te-topology:te-topology'] + if net_te_topo_id == '1': net_te_topo_type['ietf-otn-topology:otn-topology'] = {} + if net_te_topo_id == '2': net_te_topo_type['ietf-eth-te-topology:eth-tran-topology'] = {} - # TODO: improve this workaround to enhance performance - response = jsonify(json.loads(pybindJSON.dumps(ietf_net, mode='ietf'))) + response = jsonify(json_response) response.status_code = HTTP_OK except Exception as e: # pylint: disable=broad-except LOGGER.exception('Something went wrong Retrieving Topology({:s})'.format(str(topology_id))) diff --git a/src/nbi/tests/data/descriptor-topology.json b/src/nbi/tests/data/descriptor-topology.json deleted file mode 100644 index d8c6c4844..000000000 --- a/src/nbi/tests/data/descriptor-topology.json +++ /dev/null @@ -1,201 +0,0 @@ -{ - "dummy_mode": true, - "contexts": [ - {"context_id": {"context_uuid": {"uuid": "admin"}}, "name": "admin"} - ], - "topologies": [ - {"topology_id": {"topology_uuid": {"uuid": "admin"}, "context_id": {"context_uuid": {"uuid": "admin"}}}, "name": "admin"} - ], - "devices": [ - {"device_id": {"device_uuid": {"uuid": "fr1.fr"}}, "device_type": "emu-packet-router", "device_operational_status": 1, "device_drivers": [0], "device_config": {"config_rules": [ - {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, - {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, - {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ - {"uuid": "client:1", "type": "copper"}, {"uuid": "client:2", "type": "copper"}, {"uuid": "client:3", "type": "copper"}, - {"uuid": "be1.be", "type": "copper"}, {"uuid": "pt1.pt", "type": "copper"}, {"uuid": "uk1.uk", "type": "copper"}, - {"uuid": "es1.es", "type": "copper"}, {"uuid": "it1.it", "type": "copper"} - ]}}} - ]}}, - {"device_id": {"device_uuid": {"uuid": "be1.be"}}, "device_type": "emu-packet-router", "device_operational_status": 1, "device_drivers": [0], "device_config": {"config_rules": [ - {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, - {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, - {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ - {"uuid": "client:1", "type": "copper"}, {"uuid": "client:2", "type": "copper"}, {"uuid": "client:3", "type": "copper"}, - {"uuid": "de1.de", "type": "copper"}, {"uuid": "gr1.gr", "type": "copper"}, {"uuid": "uk1.uk", "type": "copper"}, - {"uuid": "fr1.fr", "type": "copper"}, {"uuid": "it1.it", "type": "copper"} - ]}}} - ]}}, - {"device_id": {"device_uuid": {"uuid": "uk1.uk"}}, "device_type": "emu-packet-router", "device_operational_status": 1, "device_drivers": [0], "device_config": {"config_rules": [ - {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, - {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, - {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ - {"uuid": "client:1", "type": "copper"}, {"uuid": "client:2", "type": "copper"}, {"uuid": "client:3", "type": "copper"}, - {"uuid": "de1.de", "type": "copper"}, {"uuid": "fr1.fr", "type": "copper"}, {"uuid": "be1.be", "type": "copper"}, - {"uuid": "pt1.pt", "type": "copper"} - ]}}} - ]}}, - {"device_id": {"device_uuid": {"uuid": "de1.de"}}, "device_type": "emu-packet-router", "device_operational_status": 1, "device_drivers": [0], "device_config": {"config_rules": [ - {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, - {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, - {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ - {"uuid": "client:1", "type": "copper"}, {"uuid": "client:2", "type": "copper"}, {"uuid": "client:3", "type": "copper"}, - {"uuid": "uk1.uk", "type": "copper"}, {"uuid": "be1.be", "type": "copper"}, {"uuid": "gr1.gr", "type": "copper"} - ]}}} - ]}}, - {"device_id": {"device_uuid": {"uuid": "pt1.pt"}}, "device_type": "emu-packet-router", "device_operational_status": 1, "device_drivers": [0], "device_config": {"config_rules": [ - {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, - {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, - {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ - {"uuid": "client:1", "type": "copper"}, {"uuid": "client:2", "type": "copper"}, {"uuid": "client:3", "type": "copper"}, - {"uuid": "uk1.uk", "type": "copper"}, {"uuid": "fr1.fr", "type": "copper"}, {"uuid": "es1.es", "type": "copper"} - ]}}} - ]}}, - {"device_id": {"device_uuid": {"uuid": "es1.es"}}, "device_type": "emu-packet-router", "device_operational_status": 1, "device_drivers": [0], "device_config": {"config_rules": [ - {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, - {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, - {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ - {"uuid": "client:1", "type": "copper"}, {"uuid": "client:2", "type": "copper"}, {"uuid": "client:3", "type": "copper"}, - {"uuid": "it1.it", "type": "copper"}, {"uuid": "fr1.fr", "type": "copper"}, {"uuid": "pt1.pt", "type": "copper"} - ]}}} - ]}}, - {"device_id": {"device_uuid": {"uuid": "it1.it"}}, "device_type": "emu-packet-router", "device_operational_status": 1, "device_drivers": [0], "device_config": {"config_rules": [ - {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, - {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, - {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ - {"uuid": "client:1", "type": "copper"}, {"uuid": "client:2", "type": "copper"}, {"uuid": "client:3", "type": "copper"}, - {"uuid": "es1.es", "type": "copper"}, {"uuid": "fr1.fr", "type": "copper"}, {"uuid": "be1.be", "type": "copper"}, - {"uuid": "gr1.gr", "type": "copper"} - ]}}} - ]}}, - {"device_id": {"device_uuid": {"uuid": "gr1.gr"}}, "device_type": "emu-packet-router", "device_operational_status": 1, "device_drivers": [0], "device_config": {"config_rules": [ - {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, - {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, - {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ - {"uuid": "client:1", "type": "copper"}, {"uuid": "client:2", "type": "copper"}, {"uuid": "client:3", "type": "copper"}, - {"uuid": "it1.it", "type": "copper"}, {"uuid": "de1.de", "type": "copper"}, {"uuid": "be1.be", "type": "copper"} - ]}}} - ]}} - ], - "links": [ - {"link_id": {"link_uuid": {"uuid": "fr1.fr_be1.be"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 4.804849}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "fr1.fr"}}, "endpoint_uuid": {"uuid": "be1.be"}}, - {"device_id": {"device_uuid": {"uuid": "be1.be"}}, "endpoint_uuid": {"uuid": "fr1.fr"}} - ]}, - {"link_id": {"link_uuid": {"uuid": "uk1.uk_fr1.fr"}}, "attributes": {"total_capacity_gbps": 300, "used_capacity_gbps": 55.182499}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "uk1.uk"}}, "endpoint_uuid": {"uuid": "fr1.fr"}}, - {"device_id": {"device_uuid": {"uuid": "fr1.fr"}}, "endpoint_uuid": {"uuid": "uk1.uk"}} - ]}, - {"link_id": {"link_uuid": {"uuid": "uk1.uk_de1.de"}}, "attributes": {"total_capacity_gbps": 600, "used_capacity_gbps": 199.272255}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "uk1.uk"}}, "endpoint_uuid": {"uuid": "de1.de"}}, - {"device_id": {"device_uuid": {"uuid": "de1.de"}}, "endpoint_uuid": {"uuid": "uk1.uk"}} - ]}, - {"link_id": {"link_uuid": {"uuid": "uk1.uk_be1.be"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 14.334868}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "uk1.uk"}}, "endpoint_uuid": {"uuid": "be1.be"}}, - {"device_id": {"device_uuid": {"uuid": "be1.be"}}, "endpoint_uuid": {"uuid": "uk1.uk"}} - ]}, - {"link_id": {"link_uuid": {"uuid": "pt1.pt_uk1.uk"}}, "attributes": {"total_capacity_gbps": 400, "used_capacity_gbps": 51.415678}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "pt1.pt"}}, "endpoint_uuid": {"uuid": "uk1.uk"}}, - {"device_id": {"device_uuid": {"uuid": "uk1.uk"}}, "endpoint_uuid": {"uuid": "pt1.pt"}} - ]}, - {"link_id": {"link_uuid": {"uuid": "pt1.pt_fr1.fr"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 3.733925}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "pt1.pt"}}, "endpoint_uuid": {"uuid": "fr1.fr"}}, - {"device_id": {"device_uuid": {"uuid": "fr1.fr"}}, "endpoint_uuid": {"uuid": "pt1.pt"}} - ]}, - {"link_id": {"link_uuid": {"uuid": "pt1.pt_es1.es"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 13.32428}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "pt1.pt"}}, "endpoint_uuid": {"uuid": "es1.es"}}, - {"device_id": {"device_uuid": {"uuid": "es1.es"}}, "endpoint_uuid": {"uuid": "pt1.pt"}} - ]}, - {"link_id": {"link_uuid": {"uuid": "it1.it_gr1.gr"}}, "attributes": {"total_capacity_gbps": 800, "used_capacity_gbps": 1.593313}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "it1.it"}}, "endpoint_uuid": {"uuid": "gr1.gr"}}, - {"device_id": {"device_uuid": {"uuid": "gr1.gr"}}, "endpoint_uuid": {"uuid": "it1.it"}} - ]}, - {"link_id": {"link_uuid": {"uuid": "it1.it_fr1.fr"}}, "attributes": {"total_capacity_gbps": 200, "used_capacity_gbps": 98.574706}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "it1.it"}}, "endpoint_uuid": {"uuid": "fr1.fr"}}, - {"device_id": {"device_uuid": {"uuid": "fr1.fr"}}, "endpoint_uuid": {"uuid": "it1.it"}} - ]}, - {"link_id": {"link_uuid": {"uuid": "it1.it_es1.es"}}, "attributes": {"total_capacity_gbps": 300, "used_capacity_gbps": 18.97108}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "it1.it"}}, "endpoint_uuid": {"uuid": "es1.es"}}, - {"device_id": {"device_uuid": {"uuid": "es1.es"}}, "endpoint_uuid": {"uuid": "it1.it"}} - ]}, - {"link_id": {"link_uuid": {"uuid": "it1.it_be1.be"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 10.327772}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "it1.it"}}, "endpoint_uuid": {"uuid": "be1.be"}}, - {"device_id": {"device_uuid": {"uuid": "be1.be"}}, "endpoint_uuid": {"uuid": "it1.it"}} - ]}, - {"link_id": {"link_uuid": {"uuid": "gr1.gr_it1.it"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 7.983659}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "gr1.gr"}}, "endpoint_uuid": {"uuid": "it1.it"}}, - {"device_id": {"device_uuid": {"uuid": "it1.it"}}, "endpoint_uuid": {"uuid": "gr1.gr"}} - ]}, - {"link_id": {"link_uuid": {"uuid": "gr1.gr_de1.de"}}, "attributes": {"total_capacity_gbps": 5000, "used_capacity_gbps": 4930.897339}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "gr1.gr"}}, "endpoint_uuid": {"uuid": "de1.de"}}, - {"device_id": {"device_uuid": {"uuid": "de1.de"}}, "endpoint_uuid": {"uuid": "gr1.gr"}} - ]}, - {"link_id": {"link_uuid": {"uuid": "gr1.gr_be1.be"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 0.895539}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "gr1.gr"}}, "endpoint_uuid": {"uuid": "be1.be"}}, - {"device_id": {"device_uuid": {"uuid": "be1.be"}}, "endpoint_uuid": {"uuid": "gr1.gr"}} - ]}, - {"link_id": {"link_uuid": {"uuid": "fr1.fr_uk1.uk"}}, "attributes": {"total_capacity_gbps": 200, "used_capacity_gbps": 28.144199}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "fr1.fr"}}, "endpoint_uuid": {"uuid": "uk1.uk"}}, - {"device_id": {"device_uuid": {"uuid": "uk1.uk"}}, "endpoint_uuid": {"uuid": "fr1.fr"}} - ]}, - {"link_id": {"link_uuid": {"uuid": "fr1.fr_pt1.pt"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 1.916587}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "fr1.fr"}}, "endpoint_uuid": {"uuid": "pt1.pt"}}, - {"device_id": {"device_uuid": {"uuid": "pt1.pt"}}, "endpoint_uuid": {"uuid": "fr1.fr"}} - ]}, - {"link_id": {"link_uuid": {"uuid": "fr1.fr_it1.it"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 3.330747}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "fr1.fr"}}, "endpoint_uuid": {"uuid": "it1.it"}}, - {"device_id": {"device_uuid": {"uuid": "it1.it"}}, "endpoint_uuid": {"uuid": "fr1.fr"}} - ]}, - {"link_id": {"link_uuid": {"uuid": "fr1.fr_es1.es"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 96.682749}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "fr1.fr"}}, "endpoint_uuid": {"uuid": "es1.es"}}, - {"device_id": {"device_uuid": {"uuid": "es1.es"}}, "endpoint_uuid": {"uuid": "fr1.fr"}} - ]}, - {"link_id": {"link_uuid": {"uuid": "es1.es_pt1.pt"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 5.643483}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "es1.es"}}, "endpoint_uuid": {"uuid": "pt1.pt"}}, - {"device_id": {"device_uuid": {"uuid": "pt1.pt"}}, "endpoint_uuid": {"uuid": "es1.es"}} - ]}, - {"link_id": {"link_uuid": {"uuid": "es1.es_it1.it"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 15.353667}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "es1.es"}}, "endpoint_uuid": {"uuid": "it1.it"}}, - {"device_id": {"device_uuid": {"uuid": "it1.it"}}, "endpoint_uuid": {"uuid": "es1.es"}} - ]}, - {"link_id": {"link_uuid": {"uuid": "es1.es_fr1.fr"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 20.517778}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "es1.es"}}, "endpoint_uuid": {"uuid": "fr1.fr"}}, - {"device_id": {"device_uuid": {"uuid": "fr1.fr"}}, "endpoint_uuid": {"uuid": "es1.es"}} - ]}, - {"link_id": {"link_uuid": {"uuid": "de1.de_uk1.uk"}}, "attributes": {"total_capacity_gbps": 600, "used_capacity_gbps": 239.446965}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "de1.de"}}, "endpoint_uuid": {"uuid": "uk1.uk"}}, - {"device_id": {"device_uuid": {"uuid": "uk1.uk"}}, "endpoint_uuid": {"uuid": "de1.de"}} - ]}, - {"link_id": {"link_uuid": {"uuid": "de1.de_gr1.gr"}}, "attributes": {"total_capacity_gbps": 2100, "used_capacity_gbps": 110.602237}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "de1.de"}}, "endpoint_uuid": {"uuid": "gr1.gr"}}, - {"device_id": {"device_uuid": {"uuid": "gr1.gr"}}, "endpoint_uuid": {"uuid": "de1.de"}} - ]}, - {"link_id": {"link_uuid": {"uuid": "de1.de_be1.be"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 57.709307}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "de1.de"}}, "endpoint_uuid": {"uuid": "be1.be"}}, - {"device_id": {"device_uuid": {"uuid": "be1.be"}}, "endpoint_uuid": {"uuid": "de1.de"}} - ]}, - {"link_id": {"link_uuid": {"uuid": "uk1.uk_pt1.pt"}}, "attributes": {"total_capacity_gbps": 800, "used_capacity_gbps": 652.70225}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "uk1.uk"}}, "endpoint_uuid": {"uuid": "pt1.pt"}}, - {"device_id": {"device_uuid": {"uuid": "pt1.pt"}}, "endpoint_uuid": {"uuid": "uk1.uk"}} - ]}, - {"link_id": {"link_uuid": {"uuid": "be1.be_uk1.uk"}}, "attributes": {"total_capacity_gbps": 200, "used_capacity_gbps": 8.252107}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "be1.be"}}, "endpoint_uuid": {"uuid": "uk1.uk"}}, - {"device_id": {"device_uuid": {"uuid": "uk1.uk"}}, "endpoint_uuid": {"uuid": "be1.be"}} - ]}, - {"link_id": {"link_uuid": {"uuid": "be1.be_it1.it"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 0.357069}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "be1.be"}}, "endpoint_uuid": {"uuid": "it1.it"}}, - {"device_id": {"device_uuid": {"uuid": "it1.it"}}, "endpoint_uuid": {"uuid": "be1.be"}} - ]}, - {"link_id": {"link_uuid": {"uuid": "be1.be_de1.de"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 20.400142}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "be1.be"}}, "endpoint_uuid": {"uuid": "de1.de"}}, - {"device_id": {"device_uuid": {"uuid": "de1.de"}}, "endpoint_uuid": {"uuid": "be1.be"}} - ]}, - {"link_id": {"link_uuid": {"uuid": "be1.be_fr1.fr"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 31.346514}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "be1.be"}}, "endpoint_uuid": {"uuid": "fr1.fr"}}, - {"device_id": {"device_uuid": {"uuid": "fr1.fr"}}, "endpoint_uuid": {"uuid": "be1.be"}} - ]}, - {"link_id": {"link_uuid": {"uuid": "be1.be_gr1.gr"}}, "attributes": {"total_capacity_gbps": 100, "used_capacity_gbps": 0.026822}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "be1.be"}}, "endpoint_uuid": {"uuid": "gr1.gr"}}, - {"device_id": {"device_uuid": {"uuid": "gr1.gr"}}, "endpoint_uuid": {"uuid": "be1.be"}} - ]} - ] -} diff --git a/src/nbi/tests/data/topology-real.json b/src/nbi/tests/data/topology-real.json new file mode 100644 index 000000000..609e21288 --- /dev/null +++ b/src/nbi/tests/data/topology-real.json @@ -0,0 +1,123 @@ +{ + "contexts": [ + {"context_id": {"context_uuid": {"uuid": "admin"}}, "name": "admin"} + ], + + "topologies": [ + {"topology_id": {"topology_uuid": {"uuid": "admin" }, "context_id": {"context_uuid": {"uuid": "admin"}}}, "name": "admin" }, + {"topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}, "name": "providerId-10-clientId-0-topologyId-1"}, + {"topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-2"}, "context_id": {"context_uuid": {"uuid": "admin"}}}, "name": "providerId-10-clientId-0-topologyId-2"} + ], + + "devices": [ + {"device_id": {"device_uuid": {"uuid": "nce-t"}}, "name": "nce-t", "device_type": "emu-open-line-system", + "device_operational_status": 1, "device_drivers": [0], "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"uuid": "mgmt", "name": "mgmt", "context_uuid": "admin", "topology_uuid": "admin", "type": "mgmt"} + ]}}} + ]}}, + + {"device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, "name": "OA (PE)", "device_type": "emu-packet-router", + "device_operational_status": 1, "device_drivers": [0], "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"uuid": "mgmt", "name": "mgmt", "context_uuid": "admin", "topology_uuid": "admin", "type": "mgmt" }, + {"uuid": "uuid-200", "name": "200", "context_uuid": "admin", "topology_uuid": "providerId-10-clientId-0-topologyId-2", "type": "copper" }, + {"uuid": "uuid-500", "name": "500", "context_uuid": "admin", "topology_uuid": "providerId-10-clientId-0-topologyId-1", "type": "optical"}, + {"uuid": "uuid-501", "name": "501", "context_uuid": "admin", "topology_uuid": "providerId-10-clientId-0-topologyId-1", "type": "optical"} + ]}}} + ]}}, + + {"device_id": {"device_uuid": {"uuid": "10.0.20.1"}}, "name": "P 1", "device_type": "emu-optical-roadm", + "device_operational_status": 1, "device_drivers": [0], "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"uuid": "mgmt", "name": "mgmt", "context_uuid": "admin", "topology_uuid": "admin", "type": "mgmt" }, + {"uuid": "uuid-500", "name": "500", "context_uuid": "admin", "topology_uuid": "providerId-10-clientId-0-topologyId-1", "type": "optical"}, + {"uuid": "uuid-501", "name": "501", "context_uuid": "admin", "topology_uuid": "providerId-10-clientId-0-topologyId-1", "type": "optical"} + ]}}} + ]}}, + + {"device_id": {"device_uuid": {"uuid": "10.0.30.1"}}, "name": "OE (PE)", "device_type": "emu-packet-router", + "device_operational_status": 1, "device_drivers": [0], "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"uuid": "mgmt", "name": "mgmt", "context_uuid": "admin", "topology_uuid": "admin", "type": "mgmt" }, + {"uuid": "uuid-200", "name": "200", "context_uuid": "admin", "topology_uuid": "providerId-10-clientId-0-topologyId-2", "type": "copper" }, + {"uuid": "uuid-500", "name": "500", "context_uuid": "admin", "topology_uuid": "providerId-10-clientId-0-topologyId-1", "type": "optical"}, + {"uuid": "uuid-501", "name": "501", "context_uuid": "admin", "topology_uuid": "providerId-10-clientId-0-topologyId-1", "type": "optical"} + ]}}} + ]}}, + + {"device_id": {"device_uuid": {"uuid": "10.0.40.1"}}, "name": "P 2", "device_type": "emu-optical-roadm", + "device_operational_status": 1, "device_drivers": [0], "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"uuid": "mgmt", "name": "mgmt", "context_uuid": "admin", "topology_uuid": "admin", "type": "mgmt" }, + {"uuid": "uuid-500", "name": "500", "context_uuid": "admin", "topology_uuid": "providerId-10-clientId-0-topologyId-1", "type": "optical"}, + {"uuid": "uuid-501", "name": "501", "context_uuid": "admin", "topology_uuid": "providerId-10-clientId-0-topologyId-1", "type": "optical"} + ]}}} + ]}} + ], + + "links": [ + {"link_id": {"link_uuid": {"uuid": "nce-t/mgmt==10.0.10.1/mgmt"}}, "name": "nce-t/mgmt==10.0.10.1/mgmt", "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "nce-t" }}, "endpoint_uuid": {"uuid": "mgmt"}}, + {"device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, "endpoint_uuid": {"uuid": "mgmt"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "nce-t/mgmt==10.0.20.1/mgmt"}}, "name": "nce-t/mgmt==10.0.20.1/mgmt", "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "nce-t" }}, "endpoint_uuid": {"uuid": "mgmt"}}, + {"device_id": {"device_uuid": {"uuid": "10.0.20.1"}}, "endpoint_uuid": {"uuid": "mgmt"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "nce-t/mgmt==10.0.30.1/mgmt"}}, "name": "nce-t/mgmt==10.0.30.1/mgmt", "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "nce-t" }}, "endpoint_uuid": {"uuid": "mgmt"}}, + {"device_id": {"device_uuid": {"uuid": "10.0.30.1"}}, "endpoint_uuid": {"uuid": "mgmt"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "nce-t/mgmt==10.0.40.1/mgmt"}}, "name": "nce-t/mgmt==10.0.40.1/mgmt", "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "nce-t" }}, "endpoint_uuid": {"uuid": "mgmt"}}, + {"device_id": {"device_uuid": {"uuid": "10.0.40.1"}}, "endpoint_uuid": {"uuid": "mgmt"}} + ]}, + + {"link_id": {"link_uuid": {"uuid": "10.0.10.1/501==10.0.20.1/501"}}, "name": "10.0.10.1/501==10.0.20.1/501", "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, "endpoint_uuid": {"uuid": "uuid-501"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}}, + {"device_id": {"device_uuid": {"uuid": "10.0.20.1"}}, "endpoint_uuid": {"uuid": "uuid-501"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}} + ]}, + {"link_id": {"link_uuid": {"uuid": "10.0.20.1/501==10.0.10.1/501"}}, "name": "10.0.20.1/501==10.0.10.1/501", "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "10.0.20.1"}}, "endpoint_uuid": {"uuid": "uuid-501"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}}, + {"device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, "endpoint_uuid": {"uuid": "uuid-501"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}} + ]}, + + {"link_id": {"link_uuid": {"uuid": "10.0.10.1/500==10.0.40.1/500"}}, "name": "10.0.10.1/500==10.0.40.1/500", "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, "endpoint_uuid": {"uuid": "uuid-500"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}}, + {"device_id": {"device_uuid": {"uuid": "10.0.40.1"}}, "endpoint_uuid": {"uuid": "uuid-500"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}} + ]}, + {"link_id": {"link_uuid": {"uuid": "10.0.40.1/500==10.0.10.1/500"}}, "name": "10.0.40.1/500==10.0.10.1/500", "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "10.0.40.1"}}, "endpoint_uuid": {"uuid": "uuid-500"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}}, + {"device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, "endpoint_uuid": {"uuid": "uuid-500"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}} + ]}, + + {"link_id": {"link_uuid": {"uuid": "10.0.20.1/500==10.0.30.1/500"}}, "name": "10.0.20.1/500==10.0.30.1/500", "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "10.0.20.1"}}, "endpoint_uuid": {"uuid": "uuid-500"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}}, + {"device_id": {"device_uuid": {"uuid": "10.0.30.1"}}, "endpoint_uuid": {"uuid": "uuid-500"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}} + ]}, + {"link_id": {"link_uuid": {"uuid": "10.0.30.1/500==10.0.20.1/500"}}, "name": "10.0.30.1/500==10.0.20.1/500", "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "10.0.30.1"}}, "endpoint_uuid": {"uuid": "uuid-500"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}}, + {"device_id": {"device_uuid": {"uuid": "10.0.20.1"}}, "endpoint_uuid": {"uuid": "uuid-500"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}} + ]}, + + {"link_id": {"link_uuid": {"uuid": "10.0.40.1/501==10.0.30.1/501"}}, "name": "10.0.40.1/501==10.0.30.1/501", "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "10.0.40.1"}}, "endpoint_uuid": {"uuid": "uuid-501"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}}, + {"device_id": {"device_uuid": {"uuid": "10.0.30.1"}}, "endpoint_uuid": {"uuid": "uuid-501"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}} + ]}, + {"link_id": {"link_uuid": {"uuid": "10.0.30.1/501==10.0.40.1/501"}}, "name": "10.0.30.1/501==10.0.40.1/501", "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "10.0.30.1"}}, "endpoint_uuid": {"uuid": "uuid-501"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}}, + {"device_id": {"device_uuid": {"uuid": "10.0.40.1"}}, "endpoint_uuid": {"uuid": "uuid-501"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}} + ]} + ] +} diff --git a/src/nbi/tests/data/topology_dummy.json b/src/nbi/tests/data/topology_dummy.json new file mode 100644 index 000000000..342124405 --- /dev/null +++ b/src/nbi/tests/data/topology_dummy.json @@ -0,0 +1,335 @@ +{ + "dummy_mode": true, + + "contexts": [ + {"context_id": {"context_uuid": {"uuid": "admin"}}, "name": "admin"} + ], + + "topologies": [ + {"topology_id": {"topology_uuid": {"uuid": "admin" }, "context_id": {"context_uuid": {"uuid": "admin"}}}, "name": "admin" }, + {"topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}, "name": "providerId-10-clientId-0-topologyId-1"}, + {"topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-2"}, "context_id": {"context_uuid": {"uuid": "admin"}}}, "name": "providerId-10-clientId-0-topologyId-2"} + ], + + "devices": [ + { + "device_config": { + "config_rules": [ + {"action": "CONFIGACTION_SET", "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": "CONFIGACTION_SET", "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": "CONFIGACTION_SET", "custom": {"resource_key": "_connect/settings", "resource_value": "{\n\"endpoints\": [\n{\n\"context_uuid\": \"admin\",\n\"name\": \"mgmt\",\n\"topology_uuid\": \"admin\",\n\"type\": \"mgmt\",\n\"uuid\": \"mgmt\"\n}\n]\n}"}}, + {"action": "CONFIGACTION_SET", "custom": {"resource_key": "/endpoints/endpoint[mgmt]", "resource_value": "{\"context_uuid\": \"admin\", \"name\": \"mgmt\", \"topology_uuid\": \"admin\", \"type\": \"mgmt\", \"uuid\": \"mgmt\"}"}} + ] + }, + "device_drivers": [0], + "device_endpoints": [ + { + "endpoint_id": { + "device_id": {"device_uuid": {"uuid": "nce-t"}}, + "endpoint_uuid": {"uuid": "mgmt"}, + "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "admin"}} + }, + "endpoint_type": "mgmt", + "name": "mgmt" + } + ], + "device_id": {"device_uuid": {"uuid": "nce-t"}}, + "device_operational_status": 2, + "device_type": "emu-open-line-system", + "name": "nce-t" + }, + { + "controller_id": {"device_uuid": {"uuid": "nce-t"}}, + "device_config": { + "config_rules": [ + {"action": "CONFIGACTION_SET", "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": "CONFIGACTION_SET", "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": "CONFIGACTION_SET", "custom": {"resource_key": "_connect/settings", "resource_value": "{\n\"endpoints\": [\n{\n\"context_uuid\": \"admin\",\n\"name\": \"mgmt\",\n\"topology_uuid\": \"admin\",\n\"type\": \"mgmt\",\n\"uuid\": \"mgmt\"\n},\n{\n\"context_uuid\": \"admin\",\n\"name\": \"200\",\n\"topology_uuid\": \"providerId-10-clientId-0-topologyId-2\",\n\"type\": \"copper\",\n\"uuid\": \"uuid-200\"\n},\n{\n\"context_uuid\": \"admin\",\n\"name\": \"500\",\n\"topology_uuid\": \"providerId-10-clientId-0-topologyId-1\",\n\"type\": \"optical\",\n\"uuid\": \"uuid-500\"\n},\n{\n\"context_uuid\": \"admin\",\n\"name\": \"501\",\n\"topology_uuid\": \"providerId-10-clientId-0-topologyId-1\",\n\"type\": \"optical\",\n\"uuid\": \"uuid-501\"\n}\n]\n}"}}, + {"action": "CONFIGACTION_SET", "custom": {"resource_key": "/endpoints/endpoint[mgmt]", "resource_value": "{\"context_uuid\": \"admin\", \"name\": \"mgmt\", \"topology_uuid\": \"admin\", \"type\": \"mgmt\", \"uuid\": \"mgmt\"}"}}, + {"action": "CONFIGACTION_SET", "custom": {"resource_key": "/endpoints/endpoint[uuid-200]", "resource_value": "{\"context_uuid\": \"admin\", \"name\": \"200\", \"topology_uuid\": \"providerId-10-clientId-0-topologyId-2\", \"type\": \"copper\", \"uuid\": \"uuid-200\"}"}}, + {"action": "CONFIGACTION_SET", "custom": {"resource_key": "/endpoints/endpoint[uuid-500]", "resource_value": "{\"context_uuid\": \"admin\", \"name\": \"500\", \"topology_uuid\": \"providerId-10-clientId-0-topologyId-1\", \"type\": \"optical\", \"uuid\": \"uuid-500\"}"}}, + {"action": "CONFIGACTION_SET", "custom": {"resource_key": "/endpoints/endpoint[uuid-501]", "resource_value": "{\"context_uuid\": \"admin\", \"name\": \"501\", \"topology_uuid\": \"providerId-10-clientId-0-topologyId-1\", \"type\": \"optical\", \"uuid\": \"uuid-501\"}"}} + ] + }, + "device_drivers": [0], + "device_endpoints": [ + { + "endpoint_id": { + "device_id": {"device_uuid": {"uuid": "10.0.30.1"}}, + "endpoint_uuid": {"uuid": "uuid-200"}, + "topology_id": { + "context_id": {"context_uuid": {"uuid": "admin"}}, + "topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-2"} + } + }, + "endpoint_type": "copper", + "name": "200" + }, + { + "endpoint_id": { + "device_id": {"device_uuid": {"uuid": "10.0.30.1"}}, + "endpoint_uuid": {"uuid": "uuid-500"}, + "topology_id": { + "context_id": {"context_uuid": {"uuid": "admin"}}, + "topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"} + } + }, + "endpoint_type": "optical", + "name": "500" + }, + { + "endpoint_id": { + "device_id": {"device_uuid": {"uuid": "10.0.30.1"}}, + "endpoint_uuid": {"uuid": "mgmt"}, + "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "admin"}} + }, + "endpoint_type": "mgmt", + "name": "mgmt" + }, + { + "endpoint_id": { + "device_id": {"device_uuid": {"uuid": "10.0.30.1"}}, + "endpoint_uuid": {"uuid": "uuid-501"}, + "topology_id": { + "context_id": {"context_uuid": {"uuid": "admin"}}, + "topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"} + } + }, + "endpoint_type": "optical", + "name": "501" + } + ], + "device_id": {"device_uuid": {"uuid": "10.0.30.1"}}, + "device_operational_status": 2, + "device_type": "emu-packet-router", + "name": "10.0.30.1" + }, + { + "controller_id": {"device_uuid": {"uuid": "nce-t"}}, + "device_config": { + "config_rules": [ + {"action": "CONFIGACTION_SET", "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": "CONFIGACTION_SET", "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": "CONFIGACTION_SET", "custom": {"resource_key": "_connect/settings", "resource_value": "{\n\"endpoints\": [\n{\n\"context_uuid\": \"admin\",\n\"name\": \"mgmt\",\n\"topology_uuid\": \"admin\",\n\"type\": \"mgmt\",\n\"uuid\": \"mgmt\"\n},\n{\n\"context_uuid\": \"admin\",\n\"name\": \"500\",\n\"topology_uuid\": \"providerId-10-clientId-0-topologyId-1\",\n\"type\": \"optical\",\n\"uuid\": \"uuid-500\"\n},\n{\n\"context_uuid\": \"admin\",\n\"name\": \"501\",\n\"topology_uuid\": \"providerId-10-clientId-0-topologyId-1\",\n\"type\": \"optical\",\n\"uuid\": \"uuid-501\"\n}\n]\n}"}}, + {"action": "CONFIGACTION_SET", "custom": {"resource_key": "/endpoints/endpoint[mgmt]", "resource_value": "{\"context_uuid\": \"admin\", \"name\": \"mgmt\", \"topology_uuid\": \"admin\", \"type\": \"mgmt\", \"uuid\": \"mgmt\"}"}}, + {"action": "CONFIGACTION_SET", "custom": {"resource_key": "/endpoints/endpoint[uuid-500]", "resource_value": "{\"context_uuid\": \"admin\", \"name\": \"500\", \"topology_uuid\": \"providerId-10-clientId-0-topologyId-1\", \"type\": \"optical\", \"uuid\": \"uuid-500\"}"}}, + {"action": "CONFIGACTION_SET", "custom": {"resource_key": "/endpoints/endpoint[uuid-501]", "resource_value": "{\"context_uuid\": \"admin\", \"name\": \"501\", \"topology_uuid\": \"providerId-10-clientId-0-topologyId-1\", \"type\": \"optical\", \"uuid\": \"uuid-501\"}"}} + ] + }, + "device_drivers": [0], + "device_endpoints": [ + { + "endpoint_id": { + "device_id": {"device_uuid": {"uuid": "10.0.40.1"}}, + "endpoint_uuid": {"uuid": "uuid-501"}, + "topology_id": { + "context_id": {"context_uuid": {"uuid": "admin"}}, + "topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"} + } + }, + "endpoint_type": "optical", + "name": "501" + }, + { + "endpoint_id": { + "device_id": {"device_uuid": {"uuid": "10.0.40.1"}}, + "endpoint_uuid": {"uuid": "uuid-500"}, + "topology_id": { + "context_id": {"context_uuid": {"uuid": "admin"}}, + "topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"} + } + }, + "endpoint_type": "optical", + "name": "500" + }, + { + "endpoint_id": { + "device_id": {"device_uuid": {"uuid": "10.0.40.1"}}, + "endpoint_uuid": {"uuid": "mgmt"}, + "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "admin"}} + }, + "endpoint_type": "mgmt", + "name": "mgmt" + } + ], + "device_id": {"device_uuid": {"uuid": "10.0.40.1"}}, + "device_operational_status": 2, + "device_type": "emu-optical-roadm", + "name": "10.0.40.1" + }, + { + "controller_id": {"device_uuid": {"uuid": "nce-t"}}, + "device_config": { + "config_rules": [ + {"action": "CONFIGACTION_SET", "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": "CONFIGACTION_SET", "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": "CONFIGACTION_SET", "custom": {"resource_key": "_connect/settings", "resource_value": "{\n\"endpoints\": [\n{\n\"context_uuid\": \"admin\",\n\"name\": \"mgmt\",\n\"topology_uuid\": \"admin\",\n\"type\": \"mgmt\",\n\"uuid\": \"mgmt\"\n},\n{\n\"context_uuid\": \"admin\",\n\"name\": \"200\",\n\"topology_uuid\": \"providerId-10-clientId-0-topologyId-2\",\n\"type\": \"copper\",\n\"uuid\": \"uuid-200\"\n},\n{\n\"context_uuid\": \"admin\",\n\"name\": \"500\",\n\"topology_uuid\": \"providerId-10-clientId-0-topologyId-1\",\n\"type\": \"optical\",\n\"uuid\": \"uuid-500\"\n},\n{\n\"context_uuid\": \"admin\",\n\"name\": \"501\",\n\"topology_uuid\": \"providerId-10-clientId-0-topologyId-1\",\n\"type\": \"optical\",\n\"uuid\": \"uuid-501\"\n}\n]\n}"}}, + {"action": "CONFIGACTION_SET", "custom": {"resource_key": "/endpoints/endpoint[mgmt]", "resource_value": "{\"context_uuid\": \"admin\", \"name\": \"mgmt\", \"topology_uuid\": \"admin\", \"type\": \"mgmt\", \"uuid\": \"mgmt\"}"}}, + {"action": "CONFIGACTION_SET", "custom": {"resource_key": "/endpoints/endpoint[uuid-200]", "resource_value": "{\"context_uuid\": \"admin\", \"name\": \"200\", \"topology_uuid\": \"providerId-10-clientId-0-topologyId-2\", \"type\": \"copper\", \"uuid\": \"uuid-200\"}"}}, + {"action": "CONFIGACTION_SET", "custom": {"resource_key": "/endpoints/endpoint[uuid-500]", "resource_value": "{\"context_uuid\": \"admin\", \"name\": \"500\", \"topology_uuid\": \"providerId-10-clientId-0-topologyId-1\", \"type\": \"optical\", \"uuid\": \"uuid-500\"}"}}, + {"action": "CONFIGACTION_SET", "custom": {"resource_key": "/endpoints/endpoint[uuid-501]", "resource_value": "{\"context_uuid\": \"admin\", \"name\": \"501\", \"topology_uuid\": \"providerId-10-clientId-0-topologyId-1\", \"type\": \"optical\", \"uuid\": \"uuid-501\"}"}} + ] + }, + "device_drivers": [0], + "device_endpoints": [ + { + "endpoint_id": { + "device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, + "endpoint_uuid": {"uuid": "mgmt"}, + "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "admin"}} + }, + "endpoint_type": "mgmt", + "name": "mgmt" + }, + { + "endpoint_id": { + "device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, + "endpoint_uuid": {"uuid": "uuid-501"}, + "topology_id": { + "context_id": {"context_uuid": {"uuid": "admin"}}, + "topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"} + } + }, + "endpoint_type": "optical", + "name": "501" + }, + { + "endpoint_id": { + "device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, + "endpoint_uuid": {"uuid": "uuid-200"}, + "topology_id": { + "context_id": {"context_uuid": {"uuid": "admin"}}, + "topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-2"} + } + }, + "endpoint_type": "copper", + "name": "200" + }, + { + "endpoint_id": { + "device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, + "endpoint_uuid": {"uuid": "uuid-500"}, + "topology_id": { + "context_id": {"context_uuid": {"uuid": "admin"}}, + "topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"} + } + }, + "endpoint_type": "optical", + "name": "500" + } + ], + "device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, + "device_operational_status": 2, + "device_type": "emu-packet-router", + "name": "10.0.10.1" + }, + { + "controller_id": {"device_uuid": {"uuid": "nce-t"}}, + "device_config": { + "config_rules": [ + {"action": "CONFIGACTION_SET", "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": "CONFIGACTION_SET", "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": "CONFIGACTION_SET", "custom": {"resource_key": "_connect/settings", "resource_value": "{\n\"endpoints\": [\n{\n\"context_uuid\": \"admin\",\n\"name\": \"mgmt\",\n\"topology_uuid\": \"admin\",\n\"type\": \"mgmt\",\n\"uuid\": \"mgmt\"\n},\n{\n\"context_uuid\": \"admin\",\n\"name\": \"500\",\n\"topology_uuid\": \"providerId-10-clientId-0-topologyId-1\",\n\"type\": \"optical\",\n\"uuid\": \"uuid-500\"\n},\n{\n\"context_uuid\": \"admin\",\n\"name\": \"501\",\n\"topology_uuid\": \"providerId-10-clientId-0-topologyId-1\",\n\"type\": \"optical\",\n\"uuid\": \"uuid-501\"\n}\n]\n}"}}, + {"action": "CONFIGACTION_SET", "custom": {"resource_key": "/endpoints/endpoint[mgmt]", "resource_value": "{\"context_uuid\": \"admin\", \"name\": \"mgmt\", \"topology_uuid\": \"admin\", \"type\": \"mgmt\", \"uuid\": \"mgmt\"}"}}, + {"action": "CONFIGACTION_SET", "custom": {"resource_key": "/endpoints/endpoint[uuid-500]", "resource_value": "{\"context_uuid\": \"admin\", \"name\": \"500\", \"topology_uuid\": \"providerId-10-clientId-0-topologyId-1\", \"type\": \"optical\", \"uuid\": \"uuid-500\"}"}}, + {"action": "CONFIGACTION_SET", "custom": {"resource_key": "/endpoints/endpoint[uuid-501]", "resource_value": "{\"context_uuid\": \"admin\", \"name\": \"501\", \"topology_uuid\": \"providerId-10-clientId-0-topologyId-1\", \"type\": \"optical\", \"uuid\": \"uuid-501\"}"}} + ] + }, + "device_drivers": [0], + "device_endpoints": [ + { + "endpoint_id": { + "device_id": {"device_uuid": {"uuid": "10.0.20.1"}}, + "endpoint_uuid": {"uuid": "uuid-500"}, + "topology_id": { + "context_id": {"context_uuid": {"uuid": "admin"}}, + "topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"} + } + }, + "endpoint_type": "optical", + "name": "500" + }, + { + "endpoint_id": { + "device_id": {"device_uuid": {"uuid": "10.0.20.1"}}, + "endpoint_uuid": {"uuid": "uuid-501"}, + "topology_id": { + "context_id": {"context_uuid": {"uuid": "admin"}}, + "topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"} + } + }, + "endpoint_type": "optical", + "name": "501" + }, + { + "endpoint_id": { + "device_id": {"device_uuid": {"uuid": "10.0.20.1"}}, + "endpoint_uuid": {"uuid": "mgmt"}, + "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "admin"}} + }, + "endpoint_type": "mgmt", + "name": "mgmt" + } + ], + "device_id": {"device_uuid": {"uuid": "10.0.20.1"}}, + "device_operational_status": 2, + "device_type": "emu-optical-roadm", + "name": "10.0.20.1" + } + ], + + "links": [ + {"link_id": {"link_uuid": {"uuid": "nce-t/mgmt==10.0.10.1/mgmt"}}, "name": "nce-t/mgmt==10.0.10.1/mgmt", "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "nce-t" }}, "endpoint_uuid": {"uuid": "mgmt"}}, + {"device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, "endpoint_uuid": {"uuid": "mgmt"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "nce-t/mgmt==10.0.20.1/mgmt"}}, "name": "nce-t/mgmt==10.0.20.1/mgmt", "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "nce-t" }}, "endpoint_uuid": {"uuid": "mgmt"}}, + {"device_id": {"device_uuid": {"uuid": "10.0.20.1"}}, "endpoint_uuid": {"uuid": "mgmt"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "nce-t/mgmt==10.0.30.1/mgmt"}}, "name": "nce-t/mgmt==10.0.30.1/mgmt", "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "nce-t" }}, "endpoint_uuid": {"uuid": "mgmt"}}, + {"device_id": {"device_uuid": {"uuid": "10.0.30.1"}}, "endpoint_uuid": {"uuid": "mgmt"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "nce-t/mgmt==10.0.40.1/mgmt"}}, "name": "nce-t/mgmt==10.0.40.1/mgmt", "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "nce-t" }}, "endpoint_uuid": {"uuid": "mgmt"}}, + {"device_id": {"device_uuid": {"uuid": "10.0.40.1"}}, "endpoint_uuid": {"uuid": "mgmt"}} + ]}, + + {"link_id": {"link_uuid": {"uuid": "10.0.10.1/501==10.0.20.1/501"}}, "name": "10.0.10.1-501", "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, "endpoint_uuid": {"uuid": "uuid-501"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}}, + {"device_id": {"device_uuid": {"uuid": "10.0.20.1"}}, "endpoint_uuid": {"uuid": "uuid-501"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}} + ]}, + {"link_id": {"link_uuid": {"uuid": "10.0.20.1/501==10.0.10.1/501"}}, "name": "10.0.20.1-501", "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "10.0.20.1"}}, "endpoint_uuid": {"uuid": "uuid-501"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}}, + {"device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, "endpoint_uuid": {"uuid": "uuid-501"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}} + ]}, + + {"link_id": {"link_uuid": {"uuid": "10.0.10.1/500==10.0.40.1/500"}}, "name": "10.0.10.1-500", "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, "endpoint_uuid": {"uuid": "uuid-500"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}}, + {"device_id": {"device_uuid": {"uuid": "10.0.40.1"}}, "endpoint_uuid": {"uuid": "uuid-500"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}} + ]}, + {"link_id": {"link_uuid": {"uuid": "10.0.40.1/500==10.0.10.1/500"}}, "name": "10.0.40.1-500", "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "10.0.40.1"}}, "endpoint_uuid": {"uuid": "uuid-500"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}}, + {"device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, "endpoint_uuid": {"uuid": "uuid-500"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}} + ]}, + + {"link_id": {"link_uuid": {"uuid": "10.0.20.1/500==10.0.30.1/500"}}, "name": "10.0.20.1-500", "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "10.0.20.1"}}, "endpoint_uuid": {"uuid": "uuid-500"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}}, + {"device_id": {"device_uuid": {"uuid": "10.0.30.1"}}, "endpoint_uuid": {"uuid": "uuid-500"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}} + ]}, + {"link_id": {"link_uuid": {"uuid": "10.0.30.1/500==10.0.20.1/500"}}, "name": "10.0.30.1-500", "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "10.0.30.1"}}, "endpoint_uuid": {"uuid": "uuid-500"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}}, + {"device_id": {"device_uuid": {"uuid": "10.0.20.1"}}, "endpoint_uuid": {"uuid": "uuid-500"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}} + ]}, + + {"link_id": {"link_uuid": {"uuid": "10.0.40.1/501==10.0.30.1/501"}}, "name": "10.0.40.1-501", "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "10.0.40.1"}}, "endpoint_uuid": {"uuid": "uuid-501"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}}, + {"device_id": {"device_uuid": {"uuid": "10.0.30.1"}}, "endpoint_uuid": {"uuid": "uuid-501"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}} + ]}, + {"link_id": {"link_uuid": {"uuid": "10.0.30.1/501==10.0.40.1/501"}}, "name": "10.0.30.1-501", "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "10.0.30.1"}}, "endpoint_uuid": {"uuid": "uuid-501"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}}, + {"device_id": {"device_uuid": {"uuid": "10.0.40.1"}}, "endpoint_uuid": {"uuid": "uuid-501"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}} + ]} + ] +} diff --git a/src/nbi/tests/test_ietf_network.py b/src/nbi/tests/test_ietf_network.py index 691dbc0db..8948cc173 100644 --- a/src/nbi/tests/test_ietf_network.py +++ b/src/nbi/tests/test_ietf_network.py @@ -12,7 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import deepdiff, json, logging +from typing import Dict +import deepdiff, json, logging, operator from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME from common.proto.context_pb2 import ContextId, TopologyId from common.tools.descriptor.Loader import DescriptorLoader, check_descriptor_load_results, validate_empty_scenario @@ -27,7 +28,7 @@ from .PrepareTestScenario import ( # pylint: disable=unused-import LOGGER = logging.getLogger(__name__) LOGGER.setLevel(logging.DEBUG) -DESCRIPTOR_FILE = 'nbi/tests/data/descriptor-topology.json' +DESCRIPTOR_FILE = 'nbi/tests/data/topology_dummy.json' TARGET_DATA_FILE = 'nbi/tests/data/test-ietf-network.json' JSON_ADMIN_CONTEXT_ID = json_context_id(DEFAULT_CONTEXT_NAME) @@ -43,23 +44,51 @@ def test_prepare_environment(context_client : ContextClient) -> None: # pylint: # Verify the scenario has no services/slices response = context_client.GetContext(ADMIN_CONTEXT_ID) - assert len(response.topology_ids) == 1 + assert len(response.topology_ids) == 3 assert len(response.service_ids ) == 0 assert len(response.slice_ids ) == 0 +def sort_data(data : Dict) -> None: + if 'ietf-network:networks' not in data: return + if 'network' not in data['ietf-network:networks']: return + data['ietf-network:networks']['network'] = sorted( + data['ietf-network:networks']['network'], + key=operator.itemgetter('network-id') + ) + for network in data['ietf-network:networks']['network']: + if 'node' in network: + network['node'] = sorted( + network['node'], + key=operator.itemgetter('node-id') + ) + + if 'ietf-network-topology:termination-point' in network['node']: + network['node']['ietf-network-topology:termination-point'] = sorted( + network['node']['ietf-network-topology:termination-point'], + key=operator.itemgetter('tp-id') + ) + + if 'ietf-network-topology:link' in network: + network['ietf-network-topology:link'] = sorted( + network['ietf-network-topology:link'], + key=operator.itemgetter('link-id') + ) + def test_rest_get_networks(nbi_service_rest : RestServer): # pylint: disable=redefined-outer-name, unused-argument with open(TARGET_DATA_FILE, 'r', encoding='UTF-8') as f: target_data = json.load(f) URL = '/restconf/data/ietf-network:networks' - retieved_data = do_rest_request(URL, logger=LOGGER, expected_status_codes={200}) - diff_data = deepdiff.DeepDiff(target_data, retieved_data) + retrieved_data = do_rest_request(URL, logger=LOGGER, expected_status_codes={200}) + sort_data(retrieved_data) + sort_data(target_data ) + diff_data = deepdiff.DeepDiff(target_data, retrieved_data) LOGGER.error('Differences:\n{:s}'.format(str(diff_data.pretty()))) assert len(diff_data) == 0 def test_cleanup_environment(context_client : ContextClient) -> None: # pylint: disable=redefined-outer-name # Verify the scenario has no services/slices response = context_client.GetContext(ADMIN_CONTEXT_ID) - assert len(response.topology_ids) == 1 + assert len(response.topology_ids) == 3 assert len(response.service_ids ) == 0 assert len(response.slice_ids ) == 0 -- GitLab From 0a461052c27c20875958281b9a4de26f121be1f4 Mon Sep 17 00:00:00 2001 From: gifrerenom Date: Wed, 13 Dec 2023 18:37:49 +0000 Subject: [PATCH 04/16] WebUI component: - Added icons for client laptops --- .../static/topology_icons/Acknowledgements.txt | 6 ++++-- .../static/topology_icons/emu-laptop.png | Bin 0 -> 16735 bytes .../service/static/topology_icons/laptop.png | Bin 0 -> 18192 bytes 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 src/webui/service/static/topology_icons/emu-laptop.png create mode 100644 src/webui/service/static/topology_icons/laptop.png diff --git a/src/webui/service/static/topology_icons/Acknowledgements.txt b/src/webui/service/static/topology_icons/Acknowledgements.txt index de69c89ce..43ecee798 100644 --- a/src/webui/service/static/topology_icons/Acknowledgements.txt +++ b/src/webui/service/static/topology_icons/Acknowledgements.txt @@ -28,6 +28,8 @@ https://symbols.getvecta.com/stencil_241/289_wae.216d930c17.png => emu-optical-t https://symbols.getvecta.com/stencil_240/128_localdirector.c1e561769f.png => optical-splitter.png https://symbols.getvecta.com/stencil_241/158_local-director.6b38eab9e4.png => emu-optical-splitter.png - https://symbols.getvecta.com/stencil_240/197_radio-tower.b6138c8c29.png => radio-router.png -https://symbols.getvecta.com/stencil_241/216_radio-tower.5159339bc0.png => emu-radio-router.png \ No newline at end of file +https://symbols.getvecta.com/stencil_241/216_radio-tower.5159339bc0.png => emu-radio-router.png + +https://symbols.getvecta.com/stencil_240/124_laptop.be264ceb77.png => laptop.png +https://symbols.getvecta.com/stencil_241/154_laptop.c01910b6c8.png => emu-laptop.png diff --git a/src/webui/service/static/topology_icons/emu-laptop.png b/src/webui/service/static/topology_icons/emu-laptop.png new file mode 100644 index 0000000000000000000000000000000000000000..0c75b47e062c9dae0d3dee74c89ac22a97c93077 GIT binary patch literal 16735 zcmd_S=R2HV)HbXPMxW7p8KV;=dWqg65e%b7k6xohFM|=iw`f5kW5^IK5u*2yNQe@N z5+XVwI?v^IzxVO}3D0{R?+0JTWzW9WUVE)`o$FkZjPB`BlChBC;o(v0>1rC|;o*zi z{D6spPo6}i1>)gx;pu6rnTFVI+mN&&`ll9HQ$$JKMI?ynS%Xv?v`x2&SRITYbkYn) z4XoJcj^L#DzF2KFTpz)V5e(hosQJ8L2EED{mLhrGIvy5Kpt$=zY~oqic$oE%xu1h1 z-xas9h3(^Gr8cGln$ciLjDni#rqeSvJ}4J~rm8N|8U%d$m68CCeOD+%l>>(0(=dF) z1AZA8heulL{o*MhFM(z>s$W_agjQYPQtiPMzgkvJ0-mtgs=JLUJfB~wsyO?g%#UlbkHuP=PXw1xh`PV#3Ijuuu zGc`;+W5Hhu2_7X4<-z>lp_MS02^3WkivB4wZ8cTGJZb2&yv*P!wBkR$ecn11`S2)A-P>wk<(0XGSK0|FqP2;3mGlY25HQ1 zKTXrA-7mnxxeTwKjWRpRFlN4LnLXeA@X$7VzyDd7eSoIjm8#v}kFxpf!QUm^#DibC z?>1G!?W?tfe)|s;tZ4p{ocCNjs$7JFRU`9#=>!(PRX#H}Y-!6PqD)^`@BItH{>;e?{-o-~M z=Y`?dm&cPY42x@eTYpAcDFkg5%$(xvd!5!l36#g>s$e#>;Mldo+CJM9iNxfgz<&nF z>pKTSJfd>2AVbhojdG7~^_jD2xna8<=Ar+#3TNzJ+jcl@%{1%;E1Mp1)0p}FHEDKs z95aMTb}@KPbU;)J>s+U!53gvbFRQZeWf|Oh3*Ud>J1KYhShF;# zx&srb+T-3`C_At?7vx1@e|Gq%ap&D;%cARyG*o~gW>oBhlB7MZ5%7&sm8<>qzI#je zH`fC`7)@1Q#D2A>SA57@$LbiFl&p5n{X;2{&0lv9Z1?#1_`|hw8;39?#uCysN-s7G zd9u|o=rr%unu-}KQIvhhEy90&_U(gHKfQU=LzQ~Wd?rr))A(Dg1o6%WP9o{oUN3b% zt9KiBTYh&O33}bOrC^G8oEhC`n}=S?47E@cm_+|tMi}N13{uZI%zo?)XGv-qU8O=&u$`I* zl~oTvL_VOE(-V2O{`>$i3q0t&hg@tZfz{jfLl^>KZ?~WsVlZ=ebDAlxkkz?;-s5$L zzS7JWsuf%>RrcoV4|i@+br2kq)4?+M30lAVC$sr>;XlZ3TZk)r=o+nO9vEYS4;Icu zneupqX!^M3JiyF-ddm;TDm{9uZZ%Ngq4`VK3e?KmCQX{VS>JwZn$XEcw<4l3d{bkw z`I~L_(X^FV=pJyVEo5fw;y$xepi6~& zq*umcTExOR7a`r%Ow-vdShg^<2Y;z;TVH<%PR5T&PP#0Rfks7^USO@FJlIJO(NBb+UCI={WOKUZmZEle z`O=fn$kj#S!aC~m$Y86*cRPI6*>AaIY{gLvwg~g>gX-j1|KfVm_w|*Z_B&HM8{clC zgF%%6386}p?tls9d}Q!)Uy?T&jv8^)x~jl!Umg3QMSXyYsi}{n%z}Q^C{~@>-MQGS zC6m8YRYVnVQfhqbjYa=KGD(GQZ*fhI(DjNFFq&1pc2wVe<@##(+G&_Kzv*GB`P7h^ zgq|*v`%OjzR$}cIbe3ewL+=k!uL9GIMK^q+FuN^aT+Y~xhk#}qB{Sz*2_};h>a~|Q z1q>K*y6wX%qmQhl;?9*i+I)CzdFSfH@%Rn7=@A``nZUAqp6tMdmF8Tf-a4_&yyu&{ zb@xk^ELy(%kJj93%)q|ez!c8e^TLesAWF)AfK1B$NhcmWMB2_L?5h&TYMFI1y$74r zLF~f+$IVr$^FK0WRVVv&p7QCpkul49Kihh9zsao<67wArJ<7QC5^MVOA)?;or`X=K zm5=D=dFa6~|7bj;?Yc~J8m3dPXT(dtmql`5i!!pI*;f&5)nlaQQo?-OLE}{5)9l;d zrL1!lqqH$k!4yp5s^0HNCHPpKfc%p^$Qh*smR2bm>L%f|o_sOS@J}PQ}`B9FO=RLxbpTt`rd$9s|WGoqURv#feaK&d|T^OI@oFYM}<%Fs$ z)rv`ahYm;$`DT{!k2N_-9dw|Hw~w(KulEU+lMmdX^?wVrVsra+))}MJ(<_{Ml zrL+*NW1F?$8+6Rv34j|Hh%74etAlL3*U@g&^?40@6}e9AsK~JSZ6)H`CK$+C*=_n+ zVZGJFeU(c%nz9U@EZTx>%427)!1%@H>Ep6-WXPNWrYeD_8gVWXU2l4eyS`<^wpxmh&JrlLSmOmslR*_Thi18552%Bh$;HUQ|TeyTzGC)x{7-MlbxxSdvsKuXGgR(;CbE4dBp|5{<63^ zJA0TBCH}+v?*Le*E%-~lPu8Su15>Nt^Q7I2+eBV>G&4SXa+3e(J`e?R>6|ZfY(q?D zA1?@E^6BJv+E(-%m%G|8tMhHiyb=K0Yk|JAwqrvlzuZ%->w6HIuKW*8cd8e=z?c@F zdXR^y&kcI2i*(D>w-{%Nn=wbn(Cg(r^KQ8T7!HlKyic@7D&8Q4wYaF2|EzzmtPbA& z0gauq_Wur%fk|p3vQwLB*5XjPe__%CT<-*)r)bBjx=g5~S4}J}Ydel*-BNn5GwtdH zJ_((K@@Nlb>b!V|6OJK!A>&aug?pf`FJ2thHTZ@4NEG(+)rL}gi4d)7&&ZQ_7Dqb{ zHZA2^XY(ALcYDt`Q$LDEgMU@t?y44~;fvKsPr?#&z z%R5!1AtYWPfqb>oX*^I>ewU@ z4*PEvfk!E7J8HkUQsA}9lbcJ;Q1H9strxV-|dnYjcG>2%A&5Gu$j_a+lKzBriK2czko@qA{-f8q{OpvljS+jQ_3cV zJ)XiJPgNV_(-3|Z`O{-UQK)4pPw-@252`(zdY+aY^HFcTH*8E|aERXAdMWaK45pJ! zlJe&5g@CtTykKCpMi?uZZBCjyz{dYMrYoD(v3%esP`f#~1;0UdX8;5FeaKah;aR>l z9aK5yb=TnfLxx&5P)K0zB5^Ir*{TlbickDK_c*?e0vAkFhdt2Ln&05vUOAOT8v>S* zSW5TVN38Q?nMtLJEN&_+i_1;u`zXt*G-8{MOzDO#kOYW?)~C8r;WmINzLrTk>$7PS zw+aDu@sL}NX98G?3y5gYeumGU8mmCM%e}g+bmn~f>wh7%lpFCScYjHCOJoiPMq!eX zfs0)fdN{*$TSIeNHOX?p^+1=g^owIdArW27c!{FU=2v|)Wx+XBD@auhi9IhVOtlNu za|3KAjY9O06=>d^W0O$sdTF{M3(ytP8|?Ip=P>r@ky~CMT9p(C7*Ymi{!!mhTfflB zx$ubde@Bj<+vS+_gnQ&SFXPmsPS85T>E0EM?>{Q4*4pe>d(}5hQzwrn7q(3f#8eb z3PLa=>ID^mM$khh_m$~&Kw1obPPEkY*Q-y*6nhhRf2;Q!!hlL;l?P$N-K3JkZ||)3 zvDPuAyTe)|Ju{_bilv4A%BP%t+~X1HV`CUJ}P~}2Ys8a zay65>e@6`wJWL=#DopNfNJ?%sA9TXxlT{L&HVJj1k+nHNkm0q~fvy z@ELOVYLv99rgtN!y$-760mCd%CmKw~@o+B9G&sJI>Q~S#7a;&&5&)JK#^ThI!VFo~ zRqx4BB4Z9ZOkO%E8Xd027hC8cZaWj+praBp038i|jA#?hlCEalIPdg2h-?9T41+Q`1{)w;08Qr&}j`~V?c5#gVhOC<3+4M;b^ znX7Ex#9r2$B8Dmei_*ARkIQf!I`GUkc5zDvd`KS1f`3l-S5~AMW0~&4>{#rpjmZ?Y zI_(HP3ry5*3~)!hb$;7B^3*y`m|!gQ12j_r5AvOkN@=faO!S?s;Qc$NRgZUnCJ=)Sz0B%MOEt__orhQr6YP$&8g&jOXlrR=bB7FXmW#S0%1Cm)CTNpC=w;sh2 zQ_{eb#$b^JX#ke8PE)xf&|;D2ZSgXf`_r38_uroHw6DC>Hb(ocWXST~wd=$U^A&66 zW_b4RLq*)c|G`ry9LAP?nw3;o*p~MwMM7NtZC51H;JFDKksrK?AOi1@;J@nhQAuE4 zS4#H?rncVF|8_}>*a@X&))~M!5D|~-Ew|$(4NYT;L{mt8NWa{>?=SB-rVMLj?9{p? zv;NF3JxeP?ukVPtukbom_Q%j9-G5*gumB-&q`GFkPAaW-yhlU?|G0h2c#>;3f-PR6 zb$YNv((Ab899wimd~r55)=Pejg=@w^tZ@idI4riwg!JjwS&XB;11XSDi-O!<)`TY_>uoq#nCF6CG%%5)$So6XBBwL*GEVS>OZvjk2#)dA5! zeS@_D`1kmkEElLA;Eb$a+$&)*$0zOiEv>iL9$jKy8D5J~q5dQM3gD6nV+WYp7?eC} z9TGuAE@o=FPMec|H)>xGNHo4_84T6z(gA>A8k2;2ni5S?Y0nL##kh{Fqu@|NW~>V8 zxr`NXi^sU;2x3@xnd`OwXOCPho?E(8bylqcUkn*6JRAC-Z@+D(-(E@e?jhsBQfheKwmX71?Bc<4vKTSX5kTA7?8PQr9Dcdq z_(}a!niPG(>f+3wp(RYHhHoMqYssBl@BirOkh|+EWA_~?Wo~;+d-V?>ofv>c3|U1q zZYr3BkXNg`=K$|K_(1c{=`Y$CFY~Mu9UbWGT}1W@zd7sszskW#e7lMo2^Tl$=~uIM zAVBLkrh{boZO?XGTZv^k|0}NAo^+?+9{}$Ambt(rIIh?i{;%0s&o7+|PlwG9HUF;% z!;+JC$IT9o{rY9f=o1s64wl4I+Nq;|Ubxn7|M8zmUJMm4@3NN(TD26cS_TB;VwneY zRqMP@hPV?!!7(`j$3LT@tY1%#vdAX2J@Cw7#uSbA@YxgHE0$REgvu|N^@xOsH0&&)!Y|v~j01U9;~vz` z`KTO@?XtK%pag@>S6bEyc9fqyrqoSF?Ew@2MQhM zpApBYPkR^X#H?p1&l=A*YDedNK5R#Z7hy{CTgvoTb&)XwERHvEBO~dyq<+!r)Tku{FUkB2RsKo=s&k4dv8Z*470|jx=>^ZYnfjUxNb5gU9zZh1oxgY6JgitVeX@M7Khra;X8XX^)(zZ}V#H=X2XLApSwMbuIc5WDMK{f1s*20J=3c9HrY%FLWjGdXgyf z9LA8DZW=?as}Z;wzLy8kC0!YadSF72D$sq-oF+Yd4s;Xw{opC64=Ez zYYMCEtt%xD7k_M^c{kPIT7^b-wycKA8k-`2&Bm=K_bEwh73{kepA?A_`|ne%#IE&C zB#?883P}H#tH*&Hp2bctDc!DE-xRSFJKWK&Ev_oJeZKq>N}EZJkUp;Up)m{WVG)5f z{PBKEYS50i7Zm%mJojFS!Z47U@>&!|p)salF0n#@iN%R|#@ zmd8)k;n)onQCzlwXn^Rfwx{gzkFeKWKA&0=S@S>u9uWi)C@Bh^Tq;UPT6pgiFIH6Pru&Dg3 zQ?{YITUua}DlI4@l-z~F3^?e4vI+tnH*1JRw;mpUEZpx4I%$YH^_Dze(}eq~9+Dn% zU=lio;X0l;mHqA;#}&mI5B`;emli8GV)5tO>xW7GVRM}qL*zhXuf4nuj$c^U`XlsT zEu(2*Wz!`phsPelCxSA(C>D)nrTtFhlFJ@6qvk8>N%UmC{=?N7_G1GFR9ABm=o)1M zEl&O`s#CB{Sx*y=J>u{)uf@=)mcV{5KTmc6CgC^KKti0x%(+LwT+@N`8CF)bh1{wC z?P4tXG6$676ljJSN*Ic$gC=?K0*DKwRqYB=s%U|7PB&v&K|VjZy1AQ}^~7zLq;_NK zkIu7BIBBh6)q@-@D!J%Z%_eZ3%N_ZpMvksG8+g!F9Mq|eOHASLpjTLG^p#?$y{ITPV z&k~q1%baA+4NiZ5b@rgi8OZH7WYkl@v!4}dWdztQ#WSX1mZzcPU-bL|L^&ie$hH#M z+=hwFubyxZ)J3k6lC$*9sFHnVw$scQV6O|K!-!EhMf7edsNn6D1&6h0K+9zkTk>uN5Mdy?5( ztq;v&LR}sJL?^I{9F=wgZ!X2!M55T#$sn=11A^PHp2_ds@?(VvDOTUgJ5-$qi9 z>kfchejxo_yv1u?X8(m>>p~DM91-Zmi75FU$Uf(ndjQ9RqAzl6+kV7T>WczAv)Qn% z;KyLm2%Pt(HeRSPyaXrM=B}qD8?bg)O~40yK;0z;(+e*agId@it}VXa&A?@mdMHAZ zjz0jsTeRK58?wpxm4W_SRY3d_mhl;yNsDIi+yV|E_2=Y{Iy&io&>=#YA4E?SARhez|Xi;)cOYGOsm4cRsc^)=kE_)%G zmzJ{*$)ZjhUte`|bvWRh<2M5|&e2M=iNjz<{2UU$VX&Y884^O1FXW0KT&!fMS$Qe0P zB^bre2h*u>uNZHDi}XxWK@+kw~&u*j~8dKcMoXwQ0#VQ;1jvu2?J9Qy)A#FIC_J=oR~ zs1b;ANXPORwav#Lb`es8d*J^;)vj>hM%bc@H7|twx<_DbZcT;HZeX-pcpaQs!U09W zCim$QBMzi(Qqo#Mdu}$#9+=K#y^Z22P<%9wg_)AzPXPHQw=J@o>#9)EzTYez&%044 z4OJHq=Lz`F!O2QG$x7p-zVI-R9~i%BTm+$r?$dnNU3O`F;8L?u)Xh$821p@zMXY~o z*{lA= z`ZteDpHq?6=HPJ0sg&jrzt7DcdNGf(VY)eUKt&{iut)?uspEM|4`~!=K^_3Ql;c!P z5AUPTT8#8nFOP|~)7cfLFGGS65nKjk+(6){M#ZPR&^6#39$@tm0Yn4g;8Md8^=rg< zUB!z8Ag1N0;q6EQ{$$G+{^EYwEg)M3nKF)F;hObn)*U+L|K^$={VY_VtkLWd;uQgT zrrU}&hrFBTQw-V?@bxH%#H?xB0bmhYl}b&oB6F^|`=0ik_RMPm*jOW=dzneUkw~bY zj~bVv5ci>=!9wfzK($Vl)fKlKIyp)Fx=wIo8gV4))0sq6+#BRE6@9-~I2rCcPzZUbEr% zF@~1ZgTtO%-@(%-+6jursB#n35#cixaYSA0@2}(qoc#pE1Q(0hBmgu1LKq@WGp*F4 z-t~{0!Gq}&x1nr2xQPM8@#GhD_NJvZ*iTtOnfOcPda*l>NH3m!)(G*?o$8q`@-LVi zf4)-p>`B$3d)lxg=S@L>=lUWb<_CSO-1djFsn;~c!IkPKt&F;GBy)TPHM;EXHwTn8H8>TPHfiA*?uw|_%4&mK$xe*~`0 zM)y%g4Sfm+j=1@d#o=1Bd={b#t_JR@+zxfSfb8a*OM>wW+(hFk8B{8ugM;8M zxuQ#T^k1(PDgDy`9jJFrY@qfe(XUqx%I-vf8d}(9A0Rk~J=mt^+;UMVf~Wo!Z-+e_#Ye(Z_Y9`{`uClyXfc;{W6%vDo*XlSvPC9gfch2z~Y zD6>xhwG8>(77F|op8zd62MD2_0FB?`lz$b895iiLQX@K;cj^ImjB9zZ+LN)5_$QzA zKNu>a4gaSFS~CZ!S`KL}zHHU-JpOsHCL1(EYbx#XdMzZ+%n+Gc1-$tqX_A?(IPh0i z0`I$Rym?4$Ihz@$P+!Syp8<1leLFx%dLdc-V4Cu^F z1$RMYAlC7C*b(MVs2;(?*64A@1v{^GPa^Jg4cA3d^`tTfaL{CC&3r|trf#+1KrbLM zM9lbAhXii3>(&1(pj6E5qOvw6XlyO!OEE1qO&`8}4+zNZ z{`O0@fX!qFxCCYwV3T&`>f8jHT`+MI&FKeIE`FgcC0RI(h^pgV66jlM zLE^V&fYMSxZBZUNYl2X5zh$k9B-LegyhoGC0dv@Q6Na&~kDja*aRR5m77TJp*1eC2 zcqdP+-{Ws2Gk|qYVSb6(lp;9+EIW1|%;n1YTtbeZa-+mly5*0=z#${Fs=!tsQLMnq zaG?sv63dpz!2FlLzYWM_eYJg~9RpJrYiHPyeCrzGGQOqmSQO+g>NwZ{P?`qwEi;fj zMikYbA01({DFV$YM2s|IA1?ecAdX7yR2t0z)yLnY2sSs}CtT)9nMu6+%I$7Bu#v)z z{yosx*NrPoCZW;ilH*;r5CzyoK%Mkja}$p&=pq7;Tal$`u+M5E%J$AB2C%O&uj3EP z%xBH+BL@o71_~O$>M{XqV*<*T_Y}9`yB)`+T({9;CovW=#XVcIZ-{2KJ1-6lp8Tnv z6lehY9lp1dHAw~ioRuDpKU>$?CS#yvNVZu-%Y#V1z8_r5LJY~_+LVQVyPn+Q5Et+J z+wAl6&OWn^5=X@0gIS<1tK_^ldHXCRIvS$J<;Lba7r33EJ`f|XF_Z%vuqSPKb~{2| zDXaAJAYsB-h}w&8LNPn02%z_v_MnO=7uN z`<0rO@C?uoms|D~x8_>NiHI@a`^Cp{;f)v>DkbV6E;qmSkj25c!*!q@vuq-+U9xXb zon7ip90e46`qTBvBxo{CYNf1!m`8X)C;J+EJ$i~%tzX^`+7EA($59ClYdW5TB7-83 zN*Rxj$8Jy1VYSS|l~n78xC@BWlW6%zfYMV$hvP|=b>I{NI?TwTR&|8g!Ze=*Z^Ey4}4YEeGu%Dy`yt2bY#(@|hf7wJ)#Ww=ys06H~JVp8wkx z_NE9bQ;iWr)3(9c-s&NrWZ%~f0}f3EXm>G=kCVr*W7N+I%SPrZH4M@PHS=kWWq!SV z>MrXG zVb;b=!X6dNc*%76Q3?J6`ZQ4X&lf9fSLwt3tR$frfDgYFI_d~*OX8D|X)kHfp%J0j z%EBpjXHpHaU)P|wWkF}J`xzfvM*><&ZRZ6qh0X~Ds`t%MQ5r?ax-cfScR|9Tn~z;@ zav7g(FT9KBWVXdBl&$TuXM7KERFCH>py`v(b5H#CyY`1KGZV*?({+aA#1oO68C8CE zrRD9t2Bh_late<5NzyYPqM~9-A&Oxaocthj%9!5~%SrsO4#6R^zwzO5GeE{Xa44bJ zR#oAJ@v}N6to$5We}8c>s^gO_bq1ez&g!&#-SO|~A-{}qrQ&;d3A(n`ca-lBCcMM! z^9ru71YuI$D%d&Bj8Fy_FDH5AZjypzE_ht~=AFi(? zT|brgB?X=LrLO_4)l~0>$ss_K!Kr26^sdl75LdIPYh$?Qf}&w=&2R&enR#CSm3a+j zCc*VS7wZ}0dCYe5z~SZR$q+i}v>S!Xos&gEi-3>PE7?7Vf4=Z!_1yX}nGD(dlYReA zlI;(f$26qEA75jmB~#ml)-k@9blVu9n@1sk3Pb^*KFaK%%$bmDyZ|(3Pp?{HE6LgJ z_}%UOjF+7hrGZoZ{@u$cV>t+G{@V8QXL2t!tTHtNZOgj%JW>}ugWgvB(I)54mrAIk z4{yG!NR{FYv>}rR@%!r$xb~H^9v>w^{1+DlN+96g?&C;wmjaP7Cn;l9V2>T z1zeYlM}2a8TkEV$y>#5$a=xYnL2?J`s#z!d7WfR{)nqxBD+AEq#3xO$ev3NEm5c*O zO6p)+-<%#O^+bUSTYapu8{17MP*cinASU^lS4&Lo=6fp(w)25Bc2?zp$)v>s$F!uh z^De5(-iyA}zuG-Q(J2_|!lv3H2}kY6k9()(Qc+9-E)UQzmG2L3Ex^rUpc7K4C_9KJQbaO+jErS?BMSz!7_%X4& zz|Xc?g?^@h0U&opCD_n=TH3`q9No>Opxf{5w&L)yss$ZW^47T#2EmN{>l;UeKF^B` zi+_?P)105dU({zY-vIm$rnVQ=M9Hp^Wp8J@QsY#P_Uq!HIHS~^yzRnHGM6Bq)X%f) zhZnZ^%*7T*dsni&+2Avar&({WwC%^nJHSPANNonK%1?tIJ0UB-*@k&lZA8NhMcZV| z+!zBhv47UG#vG!*>zTK5va7@ zewLBPVRTJ{YU||LV+zwvdzW=b6pO1V|l#zJet!V*Q_ z?2^R|gBnhBnBF&Ba6*1G?)Xhks}*0>vGB1+c`~L6*~dFstWWzLd!4pvOAp?n8yhg0OE;=B z)0h#{=v(oAtjAbd&8#`XDtr@qT8os9zM3>HC9n>(NKB2qyyU2o0ffjyfh3Bx?lh8A zo7u>^j~TmO#oQ~Z{`UlCzvx;jBlG;K{-_u*Z&~^pkX!MEF=telR4H_=0IFX!O~LXi zem)M+vdc_r@cwrIuGBA6rKgdV?l3^fY>G&RVA?}?CWm@@=lFX-04GUWMaaF2 z)VH-VX*Y7=Mny~lNm^uq;yQoKTj?Q@R?QgJH5$jRGX0q)7kb4|h<>x5-K|e5BTGN0 zp5M2lED4;pfc}7NJ-bo8xnAhGkk_Xoz!rXq2nvfp_oiCQN5HfLP!-;B&sIl9XcT!j z7^%{rM>3{^gto0z46j@60)VGj4&d7zNv1O*F}alNBtda*KGwBIB}ZY4F}mb?vtw53 zYb-A)jiMPPs50oMr5mSIePd8O*rRuQm7*sfVwx0%lR1Nt@^w{!GyNGTFlnd-c=~q1 z_W1_d++VTL+->^4A_Pp|xF;;-SKrkBLVcu8O9|mI^JmjiX_H5J8NBst8=21VJ8_ya zUcvi;^Xth3`2;WSY!FBA`hYp|;8{VGLCmvHy5;sr+SjZ6PB@6TS8x%AB?{7HgUkGE z-Imd#tFGhv zRQhRm0l-YTK`$^lw+C_-5EVjb@@&tfVe|SpIF^P@R$1=H5)#h_4?SjnXGO>Lr*)fO z-z;Y`NQL2NI%MSjg&dd3i@Qm2(-k(?i79@_YM&thc)7pwYx`&1_Ub^R2QLmA5{-?P zSnE69Y#QwyPxknhBSn?LC*HVY3@B5ddA|44@XvSu>yZ8pXQFWUNrNZq?!$5U-_Q8E zNgJ#N=+c}&T>cZTt!;GP=jrt_oa0eLS5)!V0<#3~`Umi1 z6YsowRzFtavK6|=b3d6RsL)Ksbj4rrmG>Zi2hd9Z_disL&4(Wr=3zZu3;bQkBiU-P zPPtA+-62T9Z-&h_^hGh(9M;-Gq>)ZWkd^5H;{G>&#UoR_J<;Qf)KMoI*=>4}>{~g$ znvDawxdX98U=2NML&s47cb$B;0kWiI$ljv$V2nguhS%X2ec52MB}(IjtX7t#O13$} zWRh4;^|v;4HsRDZJf1zDf~0?T0d#~&&)iO=@JI3>laq$$>F%us$om3`HuB!NwV870 zFo1VW5sMy4?Il+2o6|5QW?d#~f2`@KYb*hW-W_+6CQ%bHZFZYk$oa4Wd-~BFs>2$L z(8%lq`c7}XZUj_ApC&diB6!~(Ms<`)wu{JA+!9zBOivGA!dwbGEufg^(y>#!cYVC zz2ELTV7=#k*W)862O^K>2R^=FJy&*OW5}0UQLRFv<_F{!IesP9G_2r2Xvt5XXG>Uv zT&9&N&dgOxi&7n(2ftblkxk4$M-f>GL1*#TcwvptCA62~(~<&`hVD^B_RTn0MG1Y| zhUp*QN5Pjc*kRGOZ!!lwF5@Kj2nzXiDOYm(Is2 zCb_S4{at?R*dm0W|3z6-IlEvN1ElOv_hpj#tq@qnDi5ku|oh5OA11;*)h7U4c> z%x8S^n~D6A(mO6YO%23Xee>^rc4NrR7K&2N*`g6Gt35BQ`>X};_9WzlfOz-s%J_)G zj04I!CC1#VR~j4-%s4W|_^k{K16a@`RyV7J8w?fO&zRTC;P@(XGM{}~inV;4=$!Jz zShHnW0hn$qr^Dak`v%CqL-Kd$krh%yWNBmGBCYyz4##HPea1E!2m@M%e-%mCQz(DlxPB!=pWN$k?C*%<;!hqyr2|GPjx7_G`fU@;`beRnJyGuM|^!J&352YAFcJJCPFnUU?pr+dCEv^LaQk}UuV z?s`Pm&2KZTZdQ|C!z>=}>l7FImI#~R#SNSUKuq8qR5UdAc9Gg?Y|Jr*bnhzX>`s-T zNC;F_Dy=e2L5Q(YoyT{f!6L}6r5v*dx8Q;Y_ec)d$;R6tG$7BlV^qH4ldwUwEXsiy z(@)W=Kb&$^kz%#(@4hYtiVMD_$&+{yRoRK*M)+6W1?DmS0sLhab~rGaGEo;qrd1AZ zJgBT&#&5D@d!}9{`EwwETf~vV`^uLPUEGCS1cw3>Mr2t32rCR<2Hsrmor8K1GX0Q4aCN@z|@r<^esX&D465` zcuTF*uf7yjH%6hu-@zVO(Z2$ZGR3KeRcbjsY4s5JT7i7o9~w#9lgA(e(lt9Bf27sp zKIRb6iDug!h)PT%$l{@3mehn$m#Bl#c)?~L8;C~$W4cg6nfYOx?SyJvkxVf?OgX@B zRV4|&ThPCeqyhGKTUYZIG_(J^_mUamF^lZBkwmXUt!8=T%_e1od4VIhu+;RX&CH@G z9jZ-ai}baAaWfmtfuDtFsO8}kaU2VR9hgJa&gzg5Foj@Z1~&8N`-d^S-=bya5R|l; z|MUn80io(z)pOBPyRBld6hDFPulCQ{enqi09&kOIn~5lDp5e^599bnUk&ATnYDnCn zwTzYp(0A74;suPIqe{d;XkXZ+AaW1bJQ2t@`$uQQ`B%MrmoM7h2vOf6O;%BcW!xq} z*Mv+U~Tp95=U9(vRD5)^3H&zSe08%Ff){NNCz%@D!7HM*+bD@9- znnhV?%)Cw-WT3i+NWhaA$w_O2C}!0G4faPW;Q0v{xBY4ykCj_L*pvs@WMncRK&STPgmq2l490INg;qV)wmAbMB3 zFQbmdl@W5Wq%G}6IZzfICY;b}woE^`nj<8^6pqii5$in)Up7AMSpUpoC z&@69;sWuAPtrc(K$kyY4G2!WiE?L-QYHQ5teZ}DacA3=0jX7iN$xtES5^)N(mcM>6 z3xm2!gC9dPN3}qTwT@c9ZXulc@(Et3+(SH6o%hTFH<5u-Bo?%O*|Nkls4M_OwGuAW zQ62geY%gp7_5%Mn0Z&iso@TweUF`n> Duymd< literal 0 HcmV?d00001 diff --git a/src/webui/service/static/topology_icons/laptop.png b/src/webui/service/static/topology_icons/laptop.png new file mode 100644 index 0000000000000000000000000000000000000000..e017c59aea31de5a9112ec89e5cb4d6cbc009ba6 GIT binary patch literal 18192 zcmeFZWm_Fh&@GH?VB_xYn&9s45+Jw}+}+(0G`LF$8-lw#K|-+L?!nz1-pT!(=lyd2 z!nrQs!>0F4O?Ow-s#UA!i<*ioDiRSA6ciMyyquIe6cjYezh5vs@QF`AyayB%1(dv$ zxTd$!i6KG?&H!F#L^KS1Xi^GI!C&BqL=yu;O-i#LBr}S{M1V26&uc|X%|P+NRoykI zsDMVEiVy^<401dhw^voYQ}UW%5v+e&h2c+E-yjm5u-TgCXJHv#oWk+G3Nk6uD&5Si| z+k}7vBu>$Zk%6*75WEasp{d~DdMF2G?kuKIIkBxAfz=@`*)1Xzrd8gqAR&yTa2CMW|CaLjr;7T4 zMu_x$=ugy~FK%$Oz1d<@_xZ{_guQ|8BV0(oM8O32tlIYl={fOSkeV!G?B6U#Xum7alIhdT;OE0$_Yx^Bhi{O4ZBSFtpl~ z#r=ur^zPu#)eB~m0%T0iCbut6r1Y>s9N>_pbiAH^KYe(=GeJ{AA|ov@sv!N*&Lm*Y7`OoKmuF)nzc`kU*!U`gqk1m4qaA1A*UN&KD3z zgRTW|hOsX*?+erqgIE~CQ+qVZ8+W~)BS^NInR&i1Z!97T=@Dj8Y@mjCIaP$c=T;z0 zeVr!qA%9!CKXZk1Gq;@3;(Hq9gh72pE(lS#?ZQaojaAjRsq~PCB8DXu5%y#k$!NcA zxM3wlggJ=oIgZl*emUS1=XguPA3qf!3u^E9wgkCvaTC76xP@V$4o_XH->MI&vi!m{_R`q{KnHZ!{YF&Z%SDK z%Jr+{?p{3GJ6CyqB1gI-GJ9sG1Al@C{l@=oe*6*ccy-b4eDqFH;{D0ZQFVWA;|S=r zNtH2G70fJdWo)Nh!oMx&H9Xh-=QWAW#EXK|yPPCOCq)=Bd zo$ka!28eM z_8dv}GmIQZ#t)sh3Jfok&62Ku=tRjf;am~~S9!w&1-~3?+=*-0m2=QKy`Fa#?%%4u zRYzC37=JC`N6BOX=Wg`H-$q2v_$eU5kG=Xd;#nEXKg+;qwS z3klHRo%NSCT4Vz4CfgyAnV{rE^R=-y!w>rhy?mZY5B}7x7 zA%Rsp>&j{bHi18rjc2NZ&+A@(hs_QUv-`_AF2Z|wr+|diKjw@BPrGk2b`w;2j+(#o{w_h3G1HLi(Po!Rz) znjQ^v{LP=ONB-hXbwF%Vob6d^I|DOylK6`fpL}FULAX*0{ZY^=oz&B9quqyiJ!x$!va0)#mVduRYz|e3v8hOjUm$A0jEPtlsQPN$<{$chEa%64NtOpmN;HaPij*T`gqq}(6%7jTb{ zgE(DtQtRB`tk(pD_y@D6ZD7QyB;_$cdA3Gys@&BiByp=<$=ToLS{tC~GPr6UV~wMm zts+h*v$`>$o?$mgASoAd6yZDYJJXsnc4KZU1@IgRzCM4C2HvweL*t3$rMdq-{pQB* zx_D-k^|dZki~vTmjc2eCH<}=5y$+ZJeUa@IiMdWAT@-8csUBY&oF-BeHQB7Vu5!XG z10%lkD2&+;lq}71`H`-AM}E*9`1@s#%(uTktJvl=QJ^s zk7sBMS@h{HmFsUExXu1MtFw_F>+Q8@j!lz29APb|t?>-*f#W^-U78B)y=A5nI*9J= zHkG9&p2$(|_xJKRK6G3Ly<=))n5R+kZ()TKC~g|czrir^;JHMS^Z_@sMchrW8g!YLYSO1~6%9d^{Fu7*(~+0%CBKE21uX7er}yHhsQG>)bM94Tf*%?d>T(Qm+EpfPYd+g_7PGcHEZRE4$Q zC82YYbGT{|41Ohxy#0&_Q%hm8<|W{LOpfC>x6boZc~)^NOeK-KX6;mmxY>|UlW?^< zMd2Y(iJP)Q$C4x7qj8QE%A4m8&0Td%!p^|yj{yF)me(?qR9Du(Fj9oK+o|vrTu>hd z+nM0lVhi$o0N((<0;{n$?48VHPuA;3V@sj6+K@w=I+GN&Ja`2E`l7n1ao19Vv*~%{ zG_2*akv&h)r(46&y~?rw^Hw$W(1+hNhi9$qr4-0EjXMn9qra5Lp z4&N6=79t(c^8~a_0JOIvCjSC(I4GLNl_pL04 z{pW#LP=`99ItQi6s#l$cmb0Jm=%tdX*V2+9g4)v!urgQ=<3BG;2o;DM92H7g0U$-? zpY-q&~qH6;YUk1$(TQjuUU! z3`W7HapNVra?ps@vr}Y+OwyHqOF_JpR6*dqAB?)iCcmF>>OrYDGKk5A0=S{&%~ux+8ZOh zP$OhyZ9%ih9!s=1^BWHvWG3E2BB%O=N&)wQowxS0@#+$W0~0PX*IT*zp{t#-gihd} z1UFJ3g|9Nz>2{Z}&2$$6Vg0Tf?fX)&)3%U;&3k4llQ|>u25VR{f`{*{1f#W|-*OZZ zh3b~3N|wI;jTq#4?~tNi_WeI+s7{*8`i-J#&8EK5#s6Z}!8Y7pU&23UH*=}n;s*X` z+Yf?%1M6_k3$a^LisUt~X@~7TB_n>!&>66I_guS*#!SVl5m8`ldkoL0sPXS5?^e*W zJLP~+xOxs3R%_2CI)(Q0JvQ@a)8<;)=2g_Khm?=t_SQJsEFEcg^CF5mJWg{G%-xF# zqOz1va|R!!s;>hXBT_Jc*}5_x{@k@7{r^C_JOKxzTdY_vh?MQcDGkfY@yp=lOexOz zHCSk}g2Ojcec)lXr;ZG~xWl-w{vBtnlU>;YB*qBQ%xFrgsNuM8n%0{p+z~)Czv`m? zu_bBstK-|ldQfTI?-B{=7tVVQ$PKx(XA&HgT4DiI?3UQ+=wkdYaU zWcrX5dapU9$9bWrhL)l}n8I~yt8d(fxR;-tBz;#NL45v)_f^HUwbE&7Bq5o0^NJ9J}>^@{!uS^45+ zemZRTZENpyNmPpZ8Tfw}Y90QZ!tWbCJE_b=HNKsGD_>U!M7&0!lec?lLXZaG8$Jre zo)1RLuF|7#=XrAY5$K3lb0dftfM21=f>#Gj^F9;Qh>c4NFG_(MV zn{6xcVc2jU@EsPzc15OKCfjq3PNAogNx}*FzGeQf%Uihk8;=(Qk9V_NT7p}{L;e!H zNbDI&;Sm&e>0RofmjWLwq)-Z52P9cy1-k$|sAA;J?ivkacTR(1rNZ!cV~(vS#i)$b zU>(ei7iT-oE#J{~r4E+AzM0wdxQgC>Bv`E!W1vCj&3WZHJPz90BTXrY>gdUJh z`z!;$3D}rq4rBJx{is=PLENoU#nqar4@)H%F_0!4Ra?@AlUk6sa}0Ij4t*7T%()@ zp{5Xd2XQDi4pt4*klUL+RPR4lfBXL|6K`i-O2>NUaMk>P7ytNKQ@=b#L3fEi149db zrBLrk8%n6RicnuV>H|}pFMF|snL<%8`z8om^}j6Yd;!N_ySvD>+A-9v|5ImO4;l3w-kCjxh`;Co}20DljZbiDn>T4aYq~@vEqAtb(CvS#+PM zX(g!TVp!N{<0gZQZjK2q^e_fmPFK;<(ekkG|sI;`(ymr9rF5}6?XpcW#oJ=HeWbiDjFGP6U>&# zh@CY>;L{665w(1UaRz|n%OkUk)d@$)E~)g>=nJyxLuMSop><_9$eB2s&;OYwS_oS+ z-DTDGMIDa4%5TZF{X|yOB#pLU#={&yVRF(vWg!C^R(T>%wLS?(2$pfh{5B@aZD+PK zOo^g@o)Z*GG2%Y82S(I9kIJBUG|UOPvUdod@KCLCt=4~lyY9S=Hu*3tz7NmMh>aRj zuJCv0?^6{T-ZmZo*@x;~8Q2&H$Fq6D)^Q%QHyd&$h_BRqxKq>*)mJyPq>`~8 zYNaH_S5(jHA7vB0eWqt8^9^AK?NfQ8j^OnhG(VNEe#oyU&C z1nnm4=18UCWg#Daj@iL3G#Ub3Ki%Wo;v#+BTAW3=V4zU?V}zfwV%nS4wvrx}&2xnC zWt_pg+S23L?za1jP6sVP+I}NHBP*BytYcwBu>6}qTU6$qw{71v;7}r+ts(-N7HD`s zn;0SLmtUmWDJ!hO0~cPE-2VYdL7A8@?=m-%21&wGq(pA=GNTdGLKn_WO=d;Cx@|@_BF6t3DhhH&&o1PE#U4TjzuC)2p7o!8A!y8*Ik3j*a*q>RsPn|r}J8&Uvpiv^7+KQF2 zN3FN#C-O^C!Ya>a|8nMYwVy~K>}m~XN|2QD=4OmJn--tOIZev~3D{Jk^T&pd1=ByY zITh#01bu$%Kzs~}d`{GVTS0@6a`Ul|@)UtRalH(8e>`ODZ`ish`$rzI4;|SgRh>yW zjZ2|gLZ_>EKp!AgB+Cd8Y*+6W-IXpdFHJ<=zuHXa7pRv48HE`}i(ZB9+QQ7ZS|(M! zY6fN($5+OcM!t9n1EPuF9Dr!rD$Vq-7%YLhM(6raHvv8t_Fd74nIj1g#IE)|)I_pE z1d%zYBTg8RwgdQ@VO<4wM8Os+Pg9}u5YPHwEjgg3VkZnAoGA9Edhjc^wn1~R+xZF7 zusFfb2Dw>HP*+DI<&u`dWY6PCwPcG~aQDK@(_y+~Hv^H5haz6TcXADRuw9CJl_+j_ zjml34fTw%R%5?P~dez;oFS~xj%f3@U>zif^$n1)-P&G_YWL28&(Q73%MEKCV+#cYr zA<_cA`Whm1Is6=Qa@ywD!D~N7=DRFo7%qC$ie|yNL5EW4IjCD^$fa*4DJ2W5^#enB zV;80vTP3Gk2m3|1HYY-{%9{nkQV;6BPpqO?DfZrgLrRdb&$-Ed|InSnJD04S8uw1hf6yTNe+ zg{MG6%rg8=@HCmy$or}P(BNDiH9L!@TI?waVe$SoxRY8r+TJ719$MRVCd>#h7o+ z8MGSWN&d8KyYVvo#AV`1q*KX+Gq6!*;}QvF%Lu`1A+W6ZjFE=lAe1(%muwM=?RunL z&vv@^SvS_+k1fCJ*=2))se|kHwp>vQ1x9@EM_9X!(b;`L(^A$SqlmOX_{y`_B2;ZQ zNoy}?#X8~C#^}4`7CvRNsU(MCV^dp7_{nheKCqBfVUPDy14Q@pr;er@oO7;iOKk&VPGV+2Pgys zG+Ks8Us`cKLt)%|{XY?`-Rs^T#juXOh_y}l*k=dtYTZa(LHNi+A-tx8YPYTfAontR z!BbXU#xR3#K8<;C%!SqR72O*eVJ^=z-A37om;Xqh_0?6BxcAKV&jAMj%lkJMu}kf6 z6+mcCdW<^rDzN3YiT)W6YM+rVQ58y^Iy@PG1_FEfPUBoG=_izLrtj8r!y~fa+;s&j z31*2)x8$~6b4NS@_(ulrSA?|#Fp-HXPF6DD{S7E$x{#E;ujrH&-lHAL#CmpRoN5qg z14oVa=r`X+?g`KS0sJC47d6|oq4Ct_l7*M$8L0%{-WlUJD88Xe>--13e}Kg&>QT?`(3p_?Hjvh;k{?X|=13`$dG-KF zQPE}?qvM1b`)v^GbZSr30qQ>3TCp{8Ay0d%Ep1X_^oSsT4zGDGz=OmCMRK7g0c45+ zsDa5;V|DjiOMpTan$`+-P#FG{`yY;^I+sh1_C7sqkSg{Bh@D4koi>cYm1Iwb>*sz8 zZ#x<9^XpxF0ZOm&dRXN^NQ#*{-UMCv4q@FsZo^!PKPvpwD*q=mnTK;Hb|=eAw4=K7?83_`=8wb5d+73qepB*PU91C3Ig_zjEb-7 zztcGZW;|Q>LI>a_Q6^+)_KO;qodKdvs0m7kdiji)om>(xN?_Z^QIiP_17(ZT4%Q%- z(|EIf8|G4aqxD3skj}m*#bi2>GWe3Frc>CHWH^MUYrD!_Tz`d`zvP>uA1En>1vmlpBP#HQv@=w z2uL!{_Or$UTuY+ckCMjS#Nm{li9kskhF#SULI3KaD;kT7U3kwQ5mnldUk*csAs$Dm zkPDR|F4PK7a^-+ycol@>q|=-jo=HIf-bW|`m@5=;(sO= z{|mX#r?qv7m|k4sF?9gZYKzwn7R?~hgl^DQ2p}He0t&;>ywa+FgxZRAp*rj{o&Ufo z=l^N}1UvUv+?-`kMz*<_Y-BK;WlZKG4Rva4npr>3i7aDAXm~6E`O2}{gMW>K{|5|1 zWlA)ofh2fj-aSHlN>5`kfIzcyvCv_ffveUFGZux^MsjahS9 z>$@lScRJS*TU;c7U2?o2GJ72|)`sYckb&{$yQ5eGD`NQxn|wydX{?8ugibA0hMqCt zw)`^VPLoCn*gvL}B&g2i_k8yWq+ySeR$6NwGcnL3^At*(%{zghp@Ru3XtdPJHbHyT z0ljRqk=RIJ$Z3P{gx26KkpA*KF8E#ZWlXNvj*S?FCVGW`=HSv&V4o0Iq6^2x_Ge7} zha*tO^rWjQC71>eM(J~#pBVlpb2Td7;-+J9H)7+eC}M3Xat#q>D4!H{ z1hY<}f45emWI5CzP9pq2AQ^~IqmjYfl!s3M>d#*@ASW$L0~@@m09k#`D;BsTb#N(j z1v&K0R!|I%5(!i)9Tr~5aurKlvoev+e2@?>XCUfq&(_A+)G$<_nnL5}A!$U@fzO3= zSwj>`*k&YAC^@Y_zxzJ<=(7uhx*>*~7l@_nud zc0S4qf)6u#^BX1p1)1-S$NTSR_08=+mLbD@`O=f}R6UqFpb<`+3lxQya!`&M3IU`E z%vgQV(9)IMR#m*g2a!Et>KU`rTKUeO^dOoK-n~@7O_KDEx=NLEU^ir- z2E2|JzRAWCd_yA@z%f7iHw8kVw0HWE)Uxp#op)=JnH(1TbFl9VcO6&0Aap+FqHo9m4={|6j%M0T0r{XM6_3na$$-9 zNdh#Gh+qd&Udn}_PEox(hDvq+xt1mfX^IjD3OyU<3oXGGJ6w+jR33bd0b^>~hzOcC zFqH@xjdLE*u^=@DAp2s6ig8e}p^6bhX4Xjn>{cZLPy(B^g6syl7+NSB5S7swA>7zn z!qWF(8crBvW=PADg4e$&>QZJ+&RtV=xfreqs3G8BF0MZ%z<>TnB-jVe>ovoj(*`4t zioW^W6I|xwFF2u8>OkI_7dqyB)@!E*eAqkmlT8k3+)m)KU!_Lw=%h&)B`FE8Os%}o zb7KJ7!mGmgKGcA~*Np-iU>B31|Z>_$=Q^bW#?xeeb?)HO+3Z zN*+INaQ>VFzcy1;w{-e*$ob)FCDpkp+b*Tgk9V&2T@OaK2pSW0zpvW7jCI;>C)rda zMjAR6Kk3JYIrsG!@?gi^*Vl(T<6~i0m<)+p9s8H9)VQ1ayC?=MBYe#ad4Njt zuNeIN0yN*70yZ+GZpSIzP#+BF{Z0>Uy^G|fm-GGN^ihz0^6M5MculYUY`H1dz2^_z zvb*!$VJkqD=IL|z1JInV$5hV_(Q(KrZ6{?T=bi|Xw=AP;xd5x|-`(#rx|bJ#Cvv7v zo`Tl2)YYxJ0o;RaJKfo^RBVws+Q|BA>MF9!>7ZeY`7e_5h=Wf~P2EVVwu^i1vEg?Q zd!L3D{IZslJ{7P66j84T+0!4rtNXOTkF;YSn@>bxRG8cvbx)!^f;QrN-JI{k1KL<4 z!!LUwITf@2^dosB^SIM7X`{b2daY*|R zYuEM5l2-6&o^)`e7ttx{=_&Vc_6cGQITE$0y*J@y%s+Fq;B%5ucgpxQ80pJ{ZB z)BgQnm1`hl$}g|HM8=1@XG&z(?`MsIcVYZ2&E#CSWe$~YaY+OVU3hi*gk4wxPPart zf`O&q``#tzUJjTw`>uKHJE@`B03sLrr=8z^_IH*H0U!2Te4Gq@Hy?U|KuI=C(-~t| z$rvOA1t{PyG~%2@+7a$52}QRf-2I(1;dAo20?7=L2I+a{B}ZJP`w9d-FL6#ufeli* zLUOxIxQMfMphnC)&w_iKy^P>>ZKy2icq=A(@Unq7;q^Xpbq!>JTuh_NMy&lcw>u*w zb@`{q{lfuohyHc}d`j!ucv#SO z5OqbP*o|aVcRPD0o5bl&kM@%IPHxTMS_sTtl_wY=Lh6^0S5s+RY~pBc@v-OH z%w*Igz1s4d*`|BIoLs#?P=NAU}Zq|dEZjMq|K4Y#Dh2_^mo5zQu z<*N+E8aHj1?xsf6bR^09rqAmo7yU@m=~a^{RzW?YhMKdGtyKsk%3#_Z#Cc4)}r30qNUv@*F}R z>)XF1PGKFXf{2N_>sxvV0RiGF!2_Uej(Z(K);($J-Jx9tL3mB#dy@j zFVbRVsbT%`8^OJgDK{3&T|nT|h)=>vq1%LbR9X7cDf;COo9_VKSE%FIr;q*RI$h_f zG*4vBw#Yn7*UDz)#&sCBhD4Wn9Bms+=8uo0I&EV<3325~@gEfn#IiaRoV|ryNL#OY zj~jKz;E-Ip_uCW(?3)Saj#m=C*fj}k+jO4Ew?sY{9LV`SR1R*0%fuse&!=g9}}_dw>j_SUL@1pHGY%> zWjp22M--@fUWB;y6ZfL_CVxz>4wm=)6rATwkfVyvJ^MS^C~qwE+k4Es^R2^|;7^Ub z?>u>bNOWoFf#7sY@`4@t-f|7eFXr#3`=fjWR4X-Kw`JYLl~%R}ee-k830t9o@9S~N z$tDwnxECw4n<_>9e`jr&C)YOztwa+I0C(!WqSz|eC!%OpZb8mp^U7(I zbA0SS@-rOWsVt`6fkd8g)_J1F2NONWJ3+an*+PzhAfRHOfrPP-!dVr7=;Pv5`hWDM zeWJy+Q^FC6NcT^P1Q1eL$D^z`&wD*wIbv@&c)DUKc~I?DXZC625-bO^b%E$*@W_AD zS)6quDe8aV6uBor4PT*k?!O0y&bytu%HhAuIR^TU=Lcgq4u)g|s&W%|*d@mSIW1QG z-XiS;zpO?4{RwZKG=9!iMwBeDsu-cQ*-CM=ZTtIaPk&Wo$qT%c=JR;*)SgJhNMp`0 zV=Zdz!t0@Uk2G4z9(mO36v(BbP?4Qbaui2AJjpsmoIZ4}%2gRlpRL`5TKnZMjW^J@ zM15mw|3k)$?nq+{x%PMd{y@ZDbO3ZYme$x3sX)6gO(WowS~n^S^ZqvNm@@AU8%Ryl z!yi#m7eWH5<4-gSk;9tx7n{^;ya6IVC++g`ox|FBB;w5QBe=WI_FaBHq_RgO#`cb& zm=%x6_QdB4Ma1W;@UGadWMQP~7x|}6>v1-`zJn4TReruY3mR1Bu^cEy@pGo;CzSEq z=IGxY(I+k#-svTA?j4EQrTK-BPD$@+O6*8xFi0^)Ic@9j{G_52>17F-2-80-yo#gP znBsBqNtCeXQyKirFAetR2olaCYX3Dk#HfAC8HZb8c+L@!D(7C$d+gpJNj)GoWtYdE zq9Uc+xgQakG!(HH8MVOnE4!S!eZuI<1W>%jc?rxR`IJsZRX#GC_hd-00*u@Lkkjt( zzd3&VoQ!xE;+?!Bbc8a5kRBfhB&{CC>g0IfD$<%Io{H6T}`d@90vK2A)@iMFdOt$md# zJ9V#F0A!XI3tq^RRj%wqypB1M6ac;8A{+eVs+wRJ3$&uiYaL|xoIeiCrY`QY8}G%r zyeyQC63 zj%M069ovqlab_FV4$`iRCg}z|&7JB#^UkLfkR@9ssrAaa1vp{asGrd4ljI^yD-cgw ztm+-_ph*Pq-b;?w=J<{44lbOyH_P>Ca_+!)=I#jcTC5ML6eV=&65o>a2k}q^432%n zQ80Gzs@%nMffz5WfiIa7Zx{E6njH56ovX*k355I)BK8*Jv!C7{KN$=9q%b^1>)(;0 zm7y)%5Zf3h-VH8+pQ7zqr$mTxb@(0iJ8)w=)lR=G5%SJ5){Y4`j~kDJ?v9UR9RSht z%EBGT^3k;RCPaQbXtHvvvMXSQT%eM6$%UR{1>~(ZawI?#wxWrw^@4$Mn~K2&0v0I8cQJqs$Iu8 z<}$LI-``|A>pWQ(P^in5YWo1S6a3fOV9IJb6%1TLbh5Xh50QLJuwua+hrMw$dwz$a z4&kbNKD4q)l%7``GM66}CJ@qHyHc>4fIS~wIHJu-8W2Y%4Q@${iKmeq1(9{6ALpp~ zBz$EcBy@3zC^XH%7_$>eDkvnD&k&1JDfBxL$s?Lv?GrFz`XYdV8)M0!OUrEvp$qpG z<$kiq@T&6OSCt&Fk9&6MOOpv`W{c25dYN4TV*4QqY8P_GtWRx%psU*ty;wv)w$c(jZ z6zy+aoyoXk$;jVNZ7s{^RXUuW{oB6J3rX7lV0WVbu`h!~$419n=r^gQJ)`@*uXJ^U zD)q-86oIz@@50GoPD*|_;3pY#Uq*~iM?L|1)xVzzPU48=$J1+F+_4&vYhA83rihnp z&cXomvTS@sTN0B@rLMT6aq@oRGH@hose)^359MJbwEbr~famcE39Ku-IcWg#+ z;6L){>5Y99SXmyH|D?68_AoqBU{T_deRTe4+;SWJHN7x*--xD z*bfT)Lrl`-i zE%SWP(wuXlhx@n2CbwB%N6~jdNr@_#g=^62Vi>=~Kr3>6pvXO%HeUB(rxve!AysWt z>^e>@#(|1mL_0)fol-wXY~N&&>z5crf!@jCZzi_aa9S3iV`9r`%}+xK3QIds{fTO=S48d26xAi*kZK-G ze+S(*!{Cs;o9mFE^C$?1zVZ|vtHs`vS=ziO(BrGR2#A}fso3R{S zGv|Kn2&~<}_iv^Wy09y-54jrey{ar*E@s@;0Wx>=JNHKqHcOJj#UG&#yA+O98m~j| zq4?ig_cj*o$|Cq(;7=2PI9DX94GllqD2T=Leqf) zG;axkT;AUgVXwe>6%z6eIoWf^>*|cI=q)!-#%XH)b#<}`Jry_ybz^CTwcp658Hm!T zCs@&Ki5_2yEQyroBBUPF%MbTWlY_(Qy=km0@0&Q=Y*4x?6CFN<=>u`1-Jda`t=vYA zN~any*L>x1N_m$jqQ;=oO*x`r4j*b`Sn8M8^(1zQ^V_e6>jS`0 zV3}y~kVtyjJ&r~)XA=Fr=tS%9ntDOIbaqXSlfG!W>Q&2}Xj0Fwf4-#n@Mjrt4PnVg z^67ER$h}9O%yBBko@=+jU9Ks#b|lh5VQiDF;~k;Y_+9)$KTXwU(Bg9&>FMxkt)*mH z0`Y;yJ&c4P)QTp&z}*GY4L9&{6%Zu;L1aB2^guH5eA*Bg#%TB1zO^%iT|G)|eBhcK z?8=%BBOW$pSSq$F8Xb8?*&aJ8x*89WQRlSi8ldme|C`aYau!DXu0K+xK2g0<7U|>* z9X=@#wx04eX?8pW2}S*6*Jnq0Y#eB+eFT^|>pc~-RRaP!fP+k!B2Sa8#z)>;jBQp9 z?QU`E-fx2fbE2XZDTV7F`}87%u!?~w3*X}g6}nVuaOv8*8ua`3#!q*vlaY%R?pcYn zLFi9}Is&$fbjJx4WZLyQfm|IGUr(}~9-6vi`8esVga;{%j9bG`lt~z4*vZLGI}MB| z3^+aqe1IfL9ehgUV0~-a!x((&7+??1xQNnDXSHp20<>82cFp_>m##t&u6c39RSY&y zx{@BFA4US3$ISeD`4?S;>&f%esgLUjzOZ@DTFQp*beXLtMX0q)LF-Sp<@22IB!%5np6L;&xu zi&0>90-Te9e}P*ixElkgQ(hMN0YDt2wikD{%7s~rqW#gpQ1_S_f`g4n-(j(Uq-Zx5 zz;vqZvd(0EeQAL;1Y3GZ=)Wy+5JfN4#?ix)AeN0D)N>p+u6Je`OmHsp98b4VTD15a zeX85*MN!_IsxF*tQK%vafQZtfH=f}3F^Wm@olF-+iBHA=WS~Lr;TW%o6DvnA4z5C< zWLYcp+kK@vmR!sGyvdtbBTyNhnuTG;1@)){7biYqh%f>FhPpuO<4Rce1t%XH8rKgfS*iO&pAFA=EBdg`X} zdLP>gNdFCSRB9%tRBLmO%5jG1bB{JrvW45MWzSI*&AJ5J-Hj*XHx_ww`McZO2{V+3 zY!k1mtC;fE&l&5#Tq4kxGAivic>Pp;2|2ObY$|_`e3a~K+&TDu5FncP$6aVTR)6hd zI3WovwdzYHO>TM{JLpgI99>=;H+?6@WshIBVyB)&T_q)|@Hoae| z96uTAgj6BalRJ{8`7$R}#I#Z)&9bMB+h1?`@r1HbjdZQn@;J70a3L#;VHK~Z?8KL( zd-8Fy7!v$+bP6X~EIrLNBl&rg?~T3cM#W4#oKZx_Y-H7jl?L=eku-G*rX>ClJWhK2 zVL9jeGYlN2gHtW8N?Pe~89QNn4(D~-aGN>_Beo8cJ4=~FTUdEAX&A1O3jO4KDgf}&wdNd}b^%>D`YG-G z_w~f&B5B`)2#u9+k@isM+?Wx~PxA}?@>dN+X*#0yY-Wu~!${F2A|}sKp2vSc9lGmk zbv;)UAceW1Brl_J)EEHAQf(zZr$Y&u(n(`YjA*2pZ^X`4k!`Vi@k-v9;S=h*tlAr7 zxfI#%9p_bwqhH?UtGMA*x%ItqT$gzQD%&q0)CBe6x zdbYR8qgaHhF~w@N$V)`#=KHCj#21rk_!8rT-)=cRqr#qi~#jD z$8%oQn>Uk|%C< zCz3D>_m9q>ddA-hhuEILD!lm zwqU1eNPw$c_iM?(dY+v7SL6K11DAOS@a#{uw$krGqC3xeCyK}$L*VFSl@pFzyU8@+ zt~Lv*5K(l}pIzOn4<|Z;-Sgf{%vvO-{$SQmN|gm!Ts&ju zT78Ee?&RVHD&-Sr-0=yI_TUq_7Y^^7%=jD*x8>Qm^!+^9It8StKh|y}_rg^G3_XPj z7C55JX1qr03i_LnM>l^0C&w>NL5N|(vVm`S81?1!0&dND<359xa*+a zuq4iB{>D?fk)%?uqAC2lQ@oh(ms3o9flx~xV9?b`CJ<%Zp&-=OK$H;(ovsnH0%P8g^U81D%fAH)2g@dZ1VyOEiunVD&0;veu|6=P}Rg?^cXlrtxt7^#3&DIwqNZRI{4Bp7E;KA9;TR}-mJ37Sv-+#Ilsljhr5GsK^r+Rfd-s@A+Bga84*In; z;IbYXkQhlUi55h?_&X?wusFpB%mNw|h$+kEJ8!3PJxL2{tq}!a!D^8x0W_X0#zrXR zqtD^Hx(ddx3a~+rApV+d(8tft6y0JO#7V9VgSaV2Fo4$RH`d@)5 z#FGiWGCSIrGkwhUKKGCIuS=3gH6%P}i$nx1QMgs)aH@IrCyj8@@xv z3>;7nr%>BYJ*zQI5KL94-{)utrpSp9YYqxZwQf^#NVRaEQ>mYY4tQOI7Dzyw)dEC{ zaD2HZYvzTr$+LxV_(BHskK;3EeiefIlWXdt|9u;119?+3oml9Bwxo4{F>iQ)awH*l zX4DMauK;{N^n^+sjw={BC4nbSf!Bu>_2+(tMndPJ_k-Rr4EUaw#RVLAWut;8ub zqDF;$Zb~DG+C)}ol!&`aHipgcZZwZW)8hK_!)IV665l-`)av{ifiNp(owMn3K#A0yMrnz8tEb$W zQ@PIK<2sd=4HkPC?E@ag`T&o~Si=#bHAnn&opnz`GMu`5{ao-9G1j8DtHQ> zn56mGIBQ+Y1|zP@m*&O_20@yo$!R+#r0fK)V@jE+DVeUM6cC}g)mV^yTI6w&NvrHO z$1RDOt{}kAvgKMW;}=2s)fEd~uIE+Mso&wbR;R;3D=` Date: Wed, 13 Dec 2023 18:39:39 +0000 Subject: [PATCH 05/16] NBI Component - IETF Network plugin: - Added TODO.txt file --- .../nbi_plugins/ietf_network/TODO.txt | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/TODO.txt diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/TODO.txt b/src/nbi/service/rest_server/nbi_plugins/ietf_network/TODO.txt new file mode 100644 index 000000000..dc03b0623 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/TODO.txt @@ -0,0 +1,73 @@ +WARNING src.nbi.tests.test_ietf_network:PrepareTestScenario.py:90 Request: GET http://admin:admin@127.0.0.1:18080/restconf/data/ietf-network:networks +INFO nbi.service.rest_server.RestServer:GenericRestServer.py:27 [2023-Dec-13 18:33] 127.0.0.1 GET /restconf/data/ietf-network:networks? 308 PERMANENT REDIRECT +INFO nbi.service.rest_server.nbi_plugins.ietf_network.Networks:Networks.py:41 Request: +INFO nbi.service.rest_server.RestServer:GenericRestServer.py:27 [2023-Dec-13 18:33] 127.0.0.1 GET /restconf/data/ietf-network:networks/? 200 OK +WARNING src.nbi.tests.test_ietf_network:PrepareTestScenario.py:93 Reply: {"ietf-network:networks":{"network":[{"ietf-network-topology:link":[{"destination":{"dest-node":"10.0.20.1","dest-tp":"501"},"link-id":"10.0.10.1-501","source":{"source-node":"10.0.10.1","source-tp":"501"}},{"destination":{"dest-node":"10.0.10.1","dest-tp":"501"},"link-id":"10.0.20.1-501","source":{"source-node":"10.0.20.1","source-tp":"501"}},{"destination":{"dest-node":"10.0.40.1","dest-tp":"500"},"link-id":"10.0.10.1-500","source":{"source-node":"10.0.10.1","source-tp":"500"}},{"destination":{"dest-node":"10.0.10.1","dest-tp":"500"},"link-id":"10.0.40.1-500","source":{"source-node":"10.0.40.1","source-tp":"500"}},{"destination":{"dest-node":"10.0.30.1","dest-tp":"500"},"link-id":"10.0.20.1-500","source":{"source-node":"10.0.20.1","source-tp":"500"}},{"destination":{"dest-node":"10.0.20.1","dest-tp":"500"},"link-id":"10.0.30.1-500","source":{"source-node":"10.0.30.1","source-tp":"500"}},{"destination":{"dest-node":"10.0.30.1","dest-tp":"501"},"link-id":"10.0.40.1-501","source":{"source-node":"10.0.40.1","source-tp":"501"}},{"destination":{"dest-node":"10.0.40.1","dest-tp":"501"},"link-id":"10.0.30.1-501","source":{"source-node":"10.0.30.1","source-tp":"501"}}],"ietf-te-topology:te":{"name":"Huawei-Network"},"ietf-te-topology:te-topology-identifier":{"client-id":0,"provider-id":10,"topology-id":"1"},"network-id":"providerId-10-clientId-0-topologyId-1","network-types":{"ietf-te-topology:te-topology":{"ietf-otn-topology:otn-topology":{}}},"node":[{"ietf-network-topology:termination-point":[{"tp-id":"200"},{"tp-id":"500"},{"tp-id":"501"}],"ietf-te-topology:te-node-id":"10.0.30.1","node-id":"10.0.30.1"},{"ietf-network-topology:termination-point":[{"tp-id":"501"},{"tp-id":"500"}],"ietf-te-topology:te-node-id":"10.0.40.1","node-id":"10.0.40.1"},{"ietf-network-topology:termination-point":[{"tp-id":"501"},{"tp-id":"200"},{"tp-id":"500"}],"ietf-te-topology:te-node-id":"10.0.10.1","node-id":"10.0.10.1"},{"ietf-network-topology:termination-point":[{"tp-id":"500"},{"tp-id":"501"}],"ietf-te-topology:te-node-id":"10.0.20.1","node-id":"10.0.20.1"}]},{"ietf-te-topology:te":{"name":"Huawei-Network"},"ietf-te-topology:te-topology-identifier":{"client-id":0,"provider-id":10,"topology-id":"2"},"network-id":"providerId-10-clientId-0-topologyId-2","network-types":{"ietf-te-topology:te-topology":{"ietf-eth-te-topology:eth-tran-topology":{}}},"node":[{"ietf-network-topology:termination-point":[{"tp-id":"200"},{"tp-id":"500"},{"tp-id":"501"}],"ietf-te-topology:te-node-id":"10.0.30.1","node-id":"10.0.30.1"},{"ietf-network-topology:termination-point":[{"tp-id":"501"},{"tp-id":"200"},{"tp-id":"500"}],"ietf-te-topology:te-node-id":"10.0.10.1","node-id":"10.0.10.1"}]}]}} + +ERROR src.nbi.tests.test_ietf_network:test_ietf_network.py:85 Differences: +Item root['ietf-network:networks']['network'][0]['ietf-network-topology:link'][0]['ietf-te-topology:te'] removed from dictionary. +Item root['ietf-network:networks']['network'][0]['ietf-network-topology:link'][1]['ietf-te-topology:te'] removed from dictionary. +Item root['ietf-network:networks']['network'][0]['ietf-network-topology:link'][2]['ietf-te-topology:te'] removed from dictionary. +Item root['ietf-network:networks']['network'][0]['ietf-network-topology:link'][3]['ietf-te-topology:te'] removed from dictionary. +Item root['ietf-network:networks']['network'][0]['ietf-network-topology:link'][4]['ietf-te-topology:te'] removed from dictionary. +Item root['ietf-network:networks']['network'][0]['ietf-network-topology:link'][5]['ietf-te-topology:te'] removed from dictionary. +Item root['ietf-network:networks']['network'][0]['ietf-network-topology:link'][6]['ietf-te-topology:te'] removed from dictionary. +Item root['ietf-network:networks']['network'][0]['ietf-network-topology:link'][7]['ietf-te-topology:te'] removed from dictionary. +Item root['ietf-network:networks']['network'][0]['node'][0]['ietf-te-topology:te'] removed from dictionary. +Item root['ietf-network:networks']['network'][0]['node'][0]['ietf-network-topology:termination-point'][0]['ietf-te-topology:te-tp-id'] removed from dictionary. +Item root['ietf-network:networks']['network'][0]['node'][0]['ietf-network-topology:termination-point'][0]['ietf-te-topology:te'] removed from dictionary. +Item root['ietf-network:networks']['network'][0]['node'][0]['ietf-network-topology:termination-point'][1]['ietf-te-topology:te-tp-id'] removed from dictionary. +Item root['ietf-network:networks']['network'][0]['node'][0]['ietf-network-topology:termination-point'][1]['ietf-te-topology:te'] removed from dictionary. +Item root['ietf-network:networks']['network'][0]['node'][1]['ietf-te-topology:te'] removed from dictionary. +Item root['ietf-network:networks']['network'][0]['node'][1]['ietf-network-topology:termination-point'][0]['ietf-te-topology:te-tp-id'] removed from dictionary. +Item root['ietf-network:networks']['network'][0]['node'][1]['ietf-network-topology:termination-point'][0]['ietf-te-topology:te'] removed from dictionary. +Item root['ietf-network:networks']['network'][0]['node'][1]['ietf-network-topology:termination-point'][1]['ietf-te-topology:te-tp-id'] removed from dictionary. +Item root['ietf-network:networks']['network'][0]['node'][1]['ietf-network-topology:termination-point'][1]['ietf-te-topology:te'] removed from dictionary. +Item root['ietf-network:networks']['network'][0]['node'][2]['ietf-te-topology:te'] removed from dictionary. +Item root['ietf-network:networks']['network'][0]['node'][2]['ietf-network-topology:termination-point'][0]['ietf-te-topology:te-tp-id'] removed from dictionary. +Item root['ietf-network:networks']['network'][0]['node'][2]['ietf-network-topology:termination-point'][0]['ietf-te-topology:te'] removed from dictionary. +Item root['ietf-network:networks']['network'][0]['node'][2]['ietf-network-topology:termination-point'][1]['ietf-te-topology:te-tp-id'] removed from dictionary. +Item root['ietf-network:networks']['network'][0]['node'][2]['ietf-network-topology:termination-point'][1]['ietf-te-topology:te'] removed from dictionary. +Item root['ietf-network:networks']['network'][0]['node'][3]['ietf-te-topology:te'] removed from dictionary. +Item root['ietf-network:networks']['network'][0]['node'][3]['ietf-network-topology:termination-point'][0]['ietf-te-topology:te-tp-id'] removed from dictionary. +Item root['ietf-network:networks']['network'][0]['node'][3]['ietf-network-topology:termination-point'][0]['ietf-te-topology:te'] removed from dictionary. +Item root['ietf-network:networks']['network'][0]['node'][3]['ietf-network-topology:termination-point'][1]['ietf-te-topology:te-tp-id'] removed from dictionary. +Item root['ietf-network:networks']['network'][0]['node'][3]['ietf-network-topology:termination-point'][1]['ietf-te-topology:te'] removed from dictionary. +Item root['ietf-network:networks']['network'][1]['ietf-network-topology:link'] removed from dictionary. +Item root['ietf-network:networks']['network'][1]['node'][0]['ietf-te-topology:te'] removed from dictionary. +Item root['ietf-network:networks']['network'][1]['node'][0]['ietf-network-topology:termination-point'][0]['ietf-te-topology:te-tp-id'] removed from dictionary. +Item root['ietf-network:networks']['network'][1]['node'][0]['ietf-network-topology:termination-point'][0]['ietf-eth-te-topology:eth-svc'] removed from dictionary. +Item root['ietf-network:networks']['network'][1]['node'][0]['ietf-network-topology:termination-point'][0]['ietf-te-topology:te'] removed from dictionary. +Item root['ietf-network:networks']['network'][1]['node'][0]['ietf-network-topology:termination-point'][1]['ietf-te-topology:te-tp-id'] removed from dictionary. +Item root['ietf-network:networks']['network'][1]['node'][0]['ietf-network-topology:termination-point'][1]['ietf-eth-te-topology:eth-svc'] removed from dictionary. +Item root['ietf-network:networks']['network'][1]['node'][0]['ietf-network-topology:termination-point'][1]['ietf-te-topology:te'] removed from dictionary. +Item root['ietf-network:networks']['network'][1]['node'][0]['ietf-network-topology:termination-point'][2]['ietf-te-topology:te-tp-id'] removed from dictionary. +Item root['ietf-network:networks']['network'][1]['node'][0]['ietf-network-topology:termination-point'][2]['ietf-eth-te-topology:eth-svc'] removed from dictionary. +Item root['ietf-network:networks']['network'][1]['node'][0]['ietf-network-topology:termination-point'][2]['ietf-te-topology:te'] removed from dictionary. +Item root['ietf-network:networks']['network'][1]['node'][1]['ietf-te-topology:te'] removed from dictionary. +Item root['ietf-network:networks']['network'][1]['node'][1]['ietf-network-topology:termination-point'][0]['ietf-te-topology:te-tp-id'] removed from dictionary. +Item root['ietf-network:networks']['network'][1]['node'][1]['ietf-network-topology:termination-point'][0]['ietf-eth-te-topology:eth-svc'] removed from dictionary. +Item root['ietf-network:networks']['network'][1]['node'][1]['ietf-network-topology:termination-point'][0]['ietf-te-topology:te'] removed from dictionary. +Item root['ietf-network:networks']['network'][1]['node'][1]['ietf-network-topology:termination-point'][1]['ietf-te-topology:te-tp-id'] removed from dictionary. +Item root['ietf-network:networks']['network'][1]['node'][1]['ietf-network-topology:termination-point'][1]['ietf-eth-te-topology:eth-svc'] removed from dictionary. +Item root['ietf-network:networks']['network'][1]['node'][1]['ietf-network-topology:termination-point'][1]['ietf-te-topology:te'] removed from dictionary. +Item root['ietf-network:networks']['network'][0]['node'][0]['ietf-network-topology:termination-point'][2] added to iterable. +Item root['ietf-network:networks']['network'][0]['node'][2]['ietf-network-topology:termination-point'][2] added to iterable. +Item root['ietf-network:networks']['network'][1]['node'][1]['ietf-network-topology:termination-point'][2] added to iterable. +Item root['ietf-network:networks']['network'][1]['node'][2] removed from iterable. +Item root['ietf-network:networks']['network'][1]['node'][3] removed from iterable. +Item root['ietf-network:networks']['network'][1]['node'][4] removed from iterable. +Item root['ietf-network:networks']['network'][1]['node'][5] removed from iterable. +Item root['ietf-network:networks']['network'][1]['node'][6] removed from iterable. +Value of root['ietf-network:networks']['network'][0]['node'][0]['ietf-network-topology:termination-point'][1]['tp-id'] changed from "500" to "200". +Value of root['ietf-network:networks']['network'][0]['node'][1]['ietf-network-topology:termination-point'][0]['tp-id'] changed from "501" to "500". +Value of root['ietf-network:networks']['network'][0]['node'][1]['ietf-network-topology:termination-point'][1]['tp-id'] changed from "500" to "501". +Value of root['ietf-network:networks']['network'][0]['node'][2]['ietf-network-topology:termination-point'][0]['tp-id'] changed from "500" to "200". +Value of root['ietf-network:networks']['network'][0]['node'][2]['ietf-network-topology:termination-point'][1]['tp-id'] changed from "501" to "500". +Value of root['ietf-network:networks']['network'][0]['node'][3]['ietf-network-topology:termination-point'][0]['tp-id'] changed from "500" to "501". +Value of root['ietf-network:networks']['network'][0]['node'][3]['ietf-network-topology:termination-point'][1]['tp-id'] changed from "501" to "500". +Value of root['ietf-network:networks']['network'][1]['node'][0]['ietf-network-topology:termination-point'][0]['tp-id'] changed from "200" to "501". +Value of root['ietf-network:networks']['network'][1]['node'][0]['ietf-network-topology:termination-point'][1]['tp-id'] changed from "501" to "200". +Value of root['ietf-network:networks']['network'][1]['node'][1]['ietf-network-topology:termination-point'][0]['tp-id'] changed from "501" to "200". +Value of root['ietf-network:networks']['network'][1]['node'][1]['ietf-te-topology:te-node-id'] changed from "10.0.20.1" to "10.0.30.1". +Value of root['ietf-network:networks']['network'][1]['node'][1]['node-id'] changed from "10.0.20.1" to "10.0.30.1". -- GitLab From 45b36504099338e6a057c8a94f366e4d17b6807a Mon Sep 17 00:00:00 2001 From: gifrerenom Date: Fri, 15 Dec 2023 12:46:25 +0000 Subject: [PATCH 06/16] NBI Component - IETF Network plugin: - Added missing YANG data models - Updated build-yang-bindings.sh script - Corrected unitary test test_ietf_network.py - Reorganized message composer scripts - Removed unneeded code files - Implemented composition of nodes, links, termination points, and networks - Implemented manual fixes for what pyangbind does not support - Added NameMapping class to cache entity names --- .../nbi_plugins/ietf_network/ComposeLink.py | 53 + .../ietf_network/ComposeNetwork.py | 68 + .../nbi_plugins/ietf_network/ComposeNode.py | 46 + .../ietf_network/ComposeTermPoint.py | 74 + .../nbi_plugins/ietf_network/ManualFixes.py | 57 + .../nbi_plugins/ietf_network/NameMapping.py | 46 + .../{Constants.py => NetworkTypeEnum.py} | 11 +- .../nbi_plugins/ietf_network/Networks.py | 79 +- .../nbi_plugins/ietf_network/__init__.py | 5 + .../ietf_network/build-yang-bindings.sh | 5 +- .../yang/ietf-eth-te-topology@2023-09-28.yang | 2275 +++++++++++++++++ .../ietf-eth-tran-service@2023-10-23.yang | 1004 ++++++++ .../yang/ietf-eth-tran-types@2023-10-23.yang | 457 ++++ .../ietf-trans-client-service@2023-10-23.yang | 325 +++ ...etf-trans-client-svc-types@2023-10-23.yang | 63 + src/nbi/tests/test_ietf_network.py | 11 +- 16 files changed, 4500 insertions(+), 79 deletions(-) create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeLink.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeNetwork.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeNode.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeTermPoint.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/ManualFixes.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/NameMapping.py rename src/nbi/service/rest_server/nbi_plugins/ietf_network/{Constants.py => NetworkTypeEnum.py} (67%) create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-eth-te-topology@2023-09-28.yang create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-eth-tran-service@2023-10-23.yang create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-eth-tran-types@2023-10-23.yang create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-trans-client-service@2023-10-23.yang create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-trans-client-svc-types@2023-10-23.yang diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeLink.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeLink.py new file mode 100644 index 000000000..2cc116a63 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeLink.py @@ -0,0 +1,53 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + +from common.proto.context_pb2 import Link +from .bindings.networks.network.link import link +from .NameMapping import NameMappings +from .NetworkTypeEnum import NetworkTypeEnum + +def compose_link( + ietf_link_obj : link, link_specs : Link, name_mappings : NameMappings, network_type : NetworkTypeEnum +) -> None: + src_endpoint_id = link_specs.link_endpoint_ids[0] + ietf_link_obj.source.source_node = name_mappings.get_device_name(src_endpoint_id.device_id) + ietf_link_obj.source.source_tp = name_mappings.get_endpoint_name(src_endpoint_id) + + dst_endpoint_id = link_specs.link_endpoint_ids[-1] + ietf_link_obj.destination.dest_node = name_mappings.get_device_name(dst_endpoint_id.device_id) + ietf_link_obj.destination.dest_tp = name_mappings.get_endpoint_name(dst_endpoint_id) + + ietf_link_obj.te._set_oper_status('up') + + te_link_attrs = ietf_link_obj.te.te_link_attributes + te_link_attrs.access_type = 'point-to-point' + te_link_attrs.admin_status = 'up' + te_link_attrs.name = link_specs.name + + if network_type == NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY: + link_total_cap_kbps = link_specs.attributes.total_capacity_gbps * 1e6 + link_used_cap_kbps = link_specs.attributes.used_capacity_gbps * 1e6 + link_avail_cap_kbps = link_total_cap_kbps - link_used_cap_kbps + + te_link_attrs.max_link_bandwidth.te_bandwidth.eth_bandwidth = link_total_cap_kbps + unresv_bw = te_link_attrs.unreserved_bandwidth.add(7) + unresv_bw.te_bandwidth.eth_bandwidth = link_avail_cap_kbps + elif network_type == NetworkTypeEnum.TE_OTN_TOPOLOGY: + te_link_attrs.te_delay_metric = 1 + oduitem = te_link_attrs.max_link_bandwidth.te_bandwidth.otn.odulist.add('ietf-layer1-types:ODU0') + oduitem.ts_number = 80 + + unresv_bw = te_link_attrs.unreserved_bandwidth.add(7) + oduitem = unresv_bw.te_bandwidth.otn.odulist.add('ietf-layer1-types:ODU0') + oduitem.ts_number = 80 diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeNetwork.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeNetwork.py new file mode 100644 index 000000000..49fd523ab --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeNetwork.py @@ -0,0 +1,68 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + +import logging, re +from common.proto.context_pb2 import TopologyDetails +from nbi.service.rest_server.nbi_plugins.ietf_network.NetworkTypeEnum import NetworkTypeEnum, get_network_topology_type +from .bindings.networks.network import network +from .NameMapping import NameMappings +from .ComposeNode import compose_node +from .ComposeLink import compose_link + +LOGGER = logging.getLogger(__name__) + +def compose_network(ietf_network_obj : network, topology_details : TopologyDetails) -> None: + ietf_network_obj.te.name = 'Huawei-Network' + + topology_name = topology_details.name + match = re.match(r'providerId\-([^\-]*)-clientId-([^\-]*)-topologyId-([^\-]*)', topology_name) + if match is not None: + provider_id, client_id, topology_id = match.groups() + ietf_network_obj.te_topology_identifier.provider_id = int(provider_id) + ietf_network_obj.te_topology_identifier.client_id = int(client_id) + ietf_network_obj.te_topology_identifier.topology_id = str(topology_id) + else: + ietf_network_obj.te_topology_identifier.provider_id = 10 + ietf_network_obj.te_topology_identifier.client_id = 0 + ietf_network_obj.te_topology_identifier.topology_id = '0' + + ietf_network_obj.network_types.te_topology._set_present() + # TODO: resolve setting of otn_topology/eth_tran_topology network type; not working in bindings. + # See "../ManualFixes.py". + topology_id = ietf_network_obj.te_topology_identifier.topology_id + topology_id = { + '1': NetworkTypeEnum.TE_OTN_TOPOLOGY.value, + '2': NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY.value, + }.get(topology_id, topology_id) + network_type = get_network_topology_type(topology_id) + if network_type == NetworkTypeEnum.TE_OTN_TOPOLOGY: + #ietf_network_obj.network_types.te_topology.otn_topology._set_present() + pass + elif network_type == NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY: + #ietf_network_obj.network_types.te_topology.eth_tran_topology._set_present() + pass + else: + raise Exception('Unsupported TopologyId({:s})'.format(str(topology_id))) + + name_mappings = NameMappings() + + for device in topology_details.devices: + device_name = device.name + ietf_node_obj = ietf_network_obj.node.add(device_name) + compose_node(ietf_node_obj, device, name_mappings, network_type) + + for link in topology_details.links: + link_name = link.name + ietf_link_obj = ietf_network_obj.link.add(link_name) + compose_link(ietf_link_obj, link, name_mappings, network_type) diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeNode.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeNode.py new file mode 100644 index 000000000..e40039961 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeNode.py @@ -0,0 +1,46 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + +from common.proto.context_pb2 import Device +from .bindings.networks.network.node import node +from .ComposeTermPoint import compose_term_point +from .NameMapping import NameMappings +from .NetworkTypeEnum import NetworkTypeEnum + +NODE_NAME_MAPPINGS = { + '10.0.10.1': 'OA', + '10.0.20.1': 'P', + '10.0.30.1': 'OE', + '10.0.40.1': 'P', +} + +def compose_node( + ietf_node_obj : node, device : Device, name_mappings : NameMappings, network_type : NetworkTypeEnum +) -> None: + name_mappings.store_device_name(device) + + device_name = device.name + ietf_node_obj.te_node_id = device_name + + ietf_node_obj.te._set_oper_status('up') + ietf_node_obj.te.te_node_attributes.admin_status = 'up' + ietf_node_obj.te.te_node_attributes.name = NODE_NAME_MAPPINGS.get(device_name, device_name) + + for endpoint in device.device_endpoints: + endpoint_name = endpoint.name + if endpoint_name == 'mgmt': continue + if network_type == NetworkTypeEnum.TE_OTN_TOPOLOGY and endpoint.endpoint_type != 'optical': continue + + ietf_tp_obj = ietf_node_obj.termination_point.add(endpoint_name) + compose_term_point(ietf_tp_obj, device, endpoint, name_mappings, network_type) diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeTermPoint.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeTermPoint.py new file mode 100644 index 000000000..9ac03c3e7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeTermPoint.py @@ -0,0 +1,74 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + +from common.proto.context_pb2 import Device, EndPoint +from .bindings.networks.network.node.termination_point import termination_point +from .NameMapping import NameMappings +from .NetworkTypeEnum import NetworkTypeEnum + +TP_NAME_MAPPINGS = { + (NetworkTypeEnum.TE_OTN_TOPOLOGY, '10.0.10.1', '200'): '1-1-1-1-1', + (NetworkTypeEnum.TE_OTN_TOPOLOGY, '10.0.10.1', '500'): '1-1-1-1-1', + (NetworkTypeEnum.TE_OTN_TOPOLOGY, '10.0.10.1', '501'): '1-1-1-1-1', + + (NetworkTypeEnum.TE_OTN_TOPOLOGY, '10.0.20.1', '500'): '1-1-1-1-1', + (NetworkTypeEnum.TE_OTN_TOPOLOGY, '10.0.20.1', '501'): '1-1-1-1-1', + + (NetworkTypeEnum.TE_OTN_TOPOLOGY, '10.0.30.1', '200'): '1-1-1-1-1', + (NetworkTypeEnum.TE_OTN_TOPOLOGY, '10.0.30.1', '500'): '1-1-1-1-1', + (NetworkTypeEnum.TE_OTN_TOPOLOGY, '10.0.30.1', '501'): '1-1-1-1-1', + + (NetworkTypeEnum.TE_OTN_TOPOLOGY, '10.0.40.1', '500'): '1-1-1-1-1', + (NetworkTypeEnum.TE_OTN_TOPOLOGY, '10.0.40.1', '501'): '1-1-1-1-1', +} + +def compose_term_point( + ietf_tp_obj : termination_point, device : Device, endpoint : EndPoint, name_mappings : NameMappings, + network_type : NetworkTypeEnum +) -> None: + name_mappings.store_endpoint_name(device, endpoint) + + device_name = device.name + endpoint_name = endpoint.name + + ietf_tp_obj.te_tp_id = endpoint_name + + ietf_tp_obj.te._set_oper_status('up') + ietf_tp_obj.te.admin_status = 'up' + ietf_tp_obj.te.name = TP_NAME_MAPPINGS.get((network_type, device_name, endpoint_name), endpoint_name) + + if network_type == NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY: + ietf_if_sw_cap = ietf_tp_obj.te.interface_switching_capability.add( + 'ietf-te-types:switching-l2sc ietf-te-types:lsp-encoding-ethernet' + ) + ietf_max_lsp_bw = ietf_if_sw_cap.max_lsp_bandwidth.add('7') + ietf_max_lsp_bw.te_bandwidth.eth_bandwidth = 10_000_000 # Kbps + + #ietf_tp_obj.eth_svc.client_facing = True + + ietf_tp_obj.eth_svc.supported_classification.port_classification = True + outer_tag = ietf_tp_obj.eth_svc.supported_classification.vlan_classification.outer_tag + outer_tag.supported_tag_types.append('ietf-eth-tran-types:classify-c-vlan') + outer_tag.supported_tag_types.append('ietf-eth-tran-types:classify-s-vlan') + outer_tag.vlan_bundling = False + outer_tag.vlan_range = '1-4094' + + elif network_type == NetworkTypeEnum.TE_OTN_TOPOLOGY: + #ietf_tp_obj.te.client_svc.client_facing = False + + ietf_if_sw_cap = ietf_tp_obj.te.interface_switching_capability.add( + 'ietf-te-types:switching-otn ietf-te-types:lsp-encoding-oduk' + ) + ietf_max_lsp_bw = ietf_if_sw_cap.max_lsp_bandwidth.add('7') + ietf_max_lsp_bw.te_bandwidth.otn.odu_type = 'ietf-layer1-types:ODU4' diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/ManualFixes.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/ManualFixes.py new file mode 100644 index 000000000..a5f27adaf --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/ManualFixes.py @@ -0,0 +1,57 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + +from typing import Dict + +from .NetworkTypeEnum import NetworkTypeEnum + +def manual_fixes(json_response : Dict) -> None: + # TODO: workaround to set network types manually. Currently does not work; refine bindings. + # Seems limitation of pyangbind using multiple augmentations and nested empty containers. + for json_network in json_response['ietf-network:networks']['network']: + net_te_topo_id = json_network.get('ietf-te-topology:te-topology-identifier', {}).get('topology-id') + if net_te_topo_id is None: continue + net_te_topo_type = json_network['network-types']['ietf-te-topology:te-topology'] + if net_te_topo_id == '1': + network_type = NetworkTypeEnum.TE_OTN_TOPOLOGY + net_te_topo_type['ietf-otn-topology:otn-topology'] = {} + elif net_te_topo_id == '2': + network_type = NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY + net_te_topo_type['ietf-eth-te-topology:eth-tran-topology'] = {} + else: + network_type = None + + # Fix value type of + for json_node in json_network.get('node', []): + for json_tp in json_node.get('ietf-network-topology:termination-point', []): + + if json_node['node-id'] in {'10.0.10.1', '10.0.30.1'}: + if network_type == NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY: + if 'ietf-eth-te-topology:eth-svc' in json_tp: + json_tp['ietf-eth-te-topology:eth-svc']['client-facing'] = True + + json_tp_te = json_tp.get('ietf-te-topology:te', {}) + + if network_type == NetworkTypeEnum.TE_OTN_TOPOLOGY: + json_tp_te_cs = json_tp_te.setdefault('ietf-otn-topology:client-svc', {}) + json_tp_te_cs['client-facing'] = False + + for json_if_sw_cap in json_tp_te.get('interface-switching-capability', []): + for json_max_lsp_bandwidth in json_if_sw_cap.get('max-lsp-bandwidth', []): + json_te_bw = json_max_lsp_bandwidth.get('te-bandwidth', {}) + if network_type == NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY: + if 'ietf-eth-te-topology:eth-bandwidth' in json_te_bw: + eth_bw = json_te_bw['ietf-eth-te-topology:eth-bandwidth'] + if isinstance(eth_bw, str): + json_te_bw['ietf-eth-te-topology:eth-bandwidth'] = int(eth_bw) diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/NameMapping.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/NameMapping.py new file mode 100644 index 000000000..f5f9ca5f8 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/NameMapping.py @@ -0,0 +1,46 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + +from typing import Dict, Tuple +from common.proto.context_pb2 import Device, DeviceId, EndPoint, EndPointId + +class NameMappings: + def __init__(self) -> None: + self._device_uuid_to_name : Dict[str, str] = dict() + self._endpoint_uuid_to_name : Dict[Tuple[str, str], str] = dict() + + def store_device_name(self, device : Device) -> None: + device_uuid = device.device_id.device_uuid.uuid + device_name = device.name + self._device_uuid_to_name[device_uuid] = device_name + self._device_uuid_to_name[device_name] = device_name + + def store_endpoint_name(self, device : Device, endpoint : EndPoint) -> None: + device_uuid = device.device_id.device_uuid.uuid + device_name = device.name + endpoint_uuid = endpoint.endpoint_id.endpoint_uuid.uuid + endpoint_name = endpoint.name + self._endpoint_uuid_to_name[(device_uuid, endpoint_uuid)] = endpoint_name + self._endpoint_uuid_to_name[(device_name, endpoint_uuid)] = endpoint_name + self._endpoint_uuid_to_name[(device_uuid, endpoint_name)] = endpoint_name + self._endpoint_uuid_to_name[(device_name, endpoint_name)] = endpoint_name + + def get_device_name(self, device_id : DeviceId) -> str: + device_uuid = device_id.device_uuid.uuid + return self._device_uuid_to_name.get(device_uuid, device_uuid) + + def get_endpoint_name(self, endpoint_id : EndPointId) -> str: + device_uuid = endpoint_id.device_id.device_uuid.uuid + endpoint_uuid = endpoint_id.endpoint_uuid.uuid + return self._endpoint_uuid_to_name.get((device_uuid, endpoint_uuid), endpoint_uuid) diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/Constants.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/NetworkTypeEnum.py similarity index 67% rename from src/nbi/service/rest_server/nbi_plugins/ietf_network/Constants.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network/NetworkTypeEnum.py index 555a5f8f5..62cc74219 100644 --- a/src/nbi/service/rest_server/nbi_plugins/ietf_network/Constants.py +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/NetworkTypeEnum.py @@ -12,5 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -PROVIDER_ID = 10 -CLIENT_ID = 0 +from enum import Enum +from typing import Optional + +class NetworkTypeEnum(Enum): + TE_OTN_TOPOLOGY = 'otn' + TE_ETH_TRAN_TOPOLOGY = 'eth-tran' + +def get_network_topology_type(topology_id : str) -> Optional[NetworkTypeEnum]: + return NetworkTypeEnum._value2member_map_.get(topology_id) diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/Networks.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/Networks.py index c5675f17a..1571ffb04 100644 --- a/src/nbi/service/rest_server/nbi_plugins/ietf_network/Networks.py +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/Networks.py @@ -12,22 +12,21 @@ # See the License for the specific language governing permissions and # limitations under the License. -import json, logging, re -from typing import Dict, Tuple +import json, logging +import pyangbind.lib.pybindJSON as pybindJSON from flask import request from flask.json import jsonify from flask_restful import Resource -#from common.tools.context_queries.Slice import get_slice_by_uuid -import pyangbind.lib.pybindJSON as pybindJSON from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME from common.proto.context_pb2 import ContextId from common.tools.context_queries.Topology import get_topology_details from common.tools.object_factory.Context import json_context_id from context.client.ContextClient import ContextClient -from nbi.service.rest_server.nbi_plugins.ietf_network.Constants import CLIENT_ID, PROVIDER_ID from nbi.service.rest_server.nbi_plugins.tools.Authentication import HTTP_AUTH from nbi.service.rest_server.nbi_plugins.tools.HttpStatusCodes import HTTP_OK, HTTP_SERVERERROR from .bindings import ietf_network +from .ComposeNetwork import compose_network +from .ManualFixes import manual_fixes LOGGER = logging.getLogger(__name__) @@ -63,75 +62,13 @@ class Networks(Resource): topology_name = topology_details.name ietf_net = ietf_nets.networks.network.add(topology_name) - ietf_net.te.name = 'Huawei-Network' - - match = re.match(r'providerId\-([^\-]*)-clientId-([^\-]*)-topologyId-([^\-]*)', topology_name) - if match is not None: - provider_id, client_id, topology_id = match.groups() - ietf_net.te_topology_identifier.provider_id = int(provider_id) - ietf_net.te_topology_identifier.client_id = int(client_id) - ietf_net.te_topology_identifier.topology_id = str(topology_id) - - ietf_net.network_types.te_topology._set_present() - # TODO: resolve setting of otn_topology/eth_tran_topology network type; not working in bindings. - # See below. - # ietf_net.network_types.te_topology.otn_topology._set_present() - # ietf_net.network_types.te_topology.eth_tran_topology._set_present() - - device_uuid_to_name : Dict[str, str] = dict() - endpoint_uuid_to_name : Dict[Tuple[str, str], str] = dict() - for device in topology_details.devices: - device_uuid = device.device_id.device_uuid.uuid - device_name = device.name - device_uuid_to_name[device_uuid] = device_name - device_uuid_to_name[device_name] = device_name - ietf_node = ietf_net.node.add(device_name) - ietf_node.te_node_id = device_name - - for endpoint in device.device_endpoints: - endpoint_uuid = endpoint.endpoint_id.endpoint_uuid.uuid - endpoint_name = endpoint.name - if endpoint_name == 'mgmt': continue - endpoint_uuid_to_name[(device_uuid, endpoint_uuid)] = endpoint_name - endpoint_uuid_to_name[(device_name, endpoint_uuid)] = endpoint_name - endpoint_uuid_to_name[(device_uuid, endpoint_name)] = endpoint_name - endpoint_uuid_to_name[(device_name, endpoint_name)] = endpoint_name - ietf_node.termination_point.add(endpoint_name) - - for link in topology_details.links: - link_name = link.name - ietf_link = ietf_net.link.add(link_name) - #ietf_link.link_id = link_name - - src_dev_uuid = link.link_endpoint_ids[ 0].device_id.device_uuid.uuid - src_ep_uuid = link.link_endpoint_ids[ 0].endpoint_uuid.uuid - ietf_link.source.source_node = device_uuid_to_name.get( - src_dev_uuid, src_dev_uuid - ) - ietf_link.source.source_tp = endpoint_uuid_to_name.get( - (src_dev_uuid, src_ep_uuid), src_ep_uuid - ) - - dst_dev_uuid = link.link_endpoint_ids[-1].device_id.device_uuid.uuid - dst_ep_uuid = link.link_endpoint_ids[-1].endpoint_uuid.uuid - ietf_link.destination.dest_node = device_uuid_to_name.get( - dst_dev_uuid, dst_dev_uuid - ) - ietf_link.destination.dest_tp = endpoint_uuid_to_name.get( - (dst_dev_uuid, dst_ep_uuid), dst_ep_uuid - ) + compose_network(ietf_net, topology_details) # TODO: improve these workarounds to enhance performance json_response = json.loads(pybindJSON.dumps(ietf_nets, mode='ietf')) - - # TODO: workaround to set network types manually. Currently does not work; refine bindings. - # Seems limitation of pyangbind using multiple augmentations and nested empty containers. - for json_network in json_response['ietf-network:networks']['network']: - net_te_topo_id = json_network.get('ietf-te-topology:te-topology-identifier', {}).get('topology-id') - if net_te_topo_id is None: continue - net_te_topo_type = json_network['network-types']['ietf-te-topology:te-topology'] - if net_te_topo_id == '1': net_te_topo_type['ietf-otn-topology:otn-topology'] = {} - if net_te_topo_id == '2': net_te_topo_type['ietf-eth-te-topology:eth-tran-topology'] = {} + + # Workaround; pyangbind does not allow to set otn_topology / eth-tran-topology + manual_fixes(json_response) response = jsonify(json_response) response.status_code = HTTP_OK diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/__init__.py index a17e52f43..e637c6719 100644 --- a/src/nbi/service/rest_server/nbi_plugins/ietf_network/__init__.py +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/__init__.py @@ -24,6 +24,11 @@ # RFC 6991 - Common YANG Data Types # Ref: https://datatracker.ietf.org/doc/html/rfc6991 +# RFC draft-ietf-ccamp-eth-client-te-topo-yang-05 - A YANG Data Model for Ethernet TE Topology +# Ref: https://datatracker.ietf.org/doc/draft-ietf-ccamp-eth-client-te-topo-yang/ + +# RFC draft-ietf-ccamp-client-signal-yang-10 - A YANG Data Model for Transport Network Client Signals +# Ref: https://datatracker.ietf.org/doc/draft-ietf-ccamp-client-signal-yang/ from flask_restful import Resource from nbi.service.rest_server.RestServer import RestServer diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/build-yang-bindings.sh b/src/nbi/service/rest_server/nbi_plugins/ietf_network/build-yang-bindings.sh index 2828de91c..4de5f1a1f 100755 --- a/src/nbi/service/rest_server/nbi_plugins/ietf_network/build-yang-bindings.sh +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/build-yang-bindings.sh @@ -19,6 +19,8 @@ IETF_MODELS_PATH=${BASE_PATH}/yang cd ${BASE_PATH} export PYBINDPLUGIN=`/usr/bin/env python -c 'import pyangbind; import os; print ("{}/plugin".format(os.path.dirname(pyangbind.__file__)))'` +rm -rf bindings + # -p ${OC_HERCULES_MODELS_PATH}/ # --split-class-dir openconfig_hercules # --presence @@ -26,7 +28,8 @@ pyang --plugindir $PYBINDPLUGIN -p ${IETF_MODELS_PATH}/ -f pybind --split-class- ${IETF_MODELS_PATH}/ietf-network-topology@2018-02-26.yang \ ${IETF_MODELS_PATH}/ietf-network@2018-02-26.yang \ ${IETF_MODELS_PATH}/ietf-te-topology@2020-08-06.yang \ - ${IETF_MODELS_PATH}/ietf-otn-topology@2023-07-06.yang + ${IETF_MODELS_PATH}/ietf-otn-topology@2023-07-06.yang \ + ${IETF_MODELS_PATH}/ietf-eth-te-topology@2023-09-28.yang # ${IETF_MODELS_PATH}/iana-routing-types@2017-12-04.yang \ # ${IETF_MODELS_PATH}/ietf-inet-types@2013-07-15.yang \ diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-eth-te-topology@2023-09-28.yang b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-eth-te-topology@2023-09-28.yang new file mode 100644 index 000000000..b182f7f5a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-eth-te-topology@2023-09-28.yang @@ -0,0 +1,2275 @@ + module ietf-eth-te-topology { + yang-version 1.1; + namespace "urn:ietf:params:xml:ns:yang:ietf-eth-te-topology"; + prefix "etht"; + + import ietf-network { + prefix "nw"; + reference + "RFC 8345: A YANG Data Model for Network Topologies"; + } + + import ietf-network-topology { + prefix "nt"; + reference + "RFC 8345: A YANG Data Model for Network Topologies"; + } + + import ietf-te-topology { + prefix "tet"; + reference + "RFC 8795: YANG Data Model for Traffic Engineering + (TE) Topologies"; + } + + import ietf-yang-types { + prefix "yang"; + reference + "RFC 6991: Common YANG Data Types"; + } + + import ietf-eth-tran-types { + prefix "etht-types"; + reference + "RFC YYYY: A YANG Data Model for Transport Network Client + Signals"; + } + // RFC Ed.: replace YYYY with actual RFC number, update date + // information and remove this note + + organization + "IETF CCAMP Working Group"; + contact + "WG Web: + WG List: + + Editor: Haomian Zheng + + + Editor: Italo Busi + + + Editor: Aihua Guo + + + Editor: Yunbin Xu + + + Editor: Yang Zhao + + + Editor: Xufeng Liu + "; + + description + "This module defines a YANG data model for describing + layer-2 Ethernet transport topologies. The model fully + conforms to the Network Management Datastore + Architecture (NMDA). + + Copyright (c) 2023 IETF Trust and the persons identified + as authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Revised BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (https://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC XXXX; see + the RFC itself for full legal notices. + + The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL + NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED', + 'MAY', and 'OPTIONAL' in this document are to be interpreted as + described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, + they appear in all capitals, as shown here."; + + revision 2023-09-28 { + description + "Initial Revision"; + reference + "RFC XXXX: A YANG Data Model for Ethernet TE Topology"; + // RFC Ed.: replace XXXX with actual RFC number, update date + // information and remove this note + } + + /* + * Groupings + */ + + grouping label-range-info { + description + "Ethernet technology-specific label range related + information with a presence container indicating that the + label range is an Ethernet technology-specific label range. + + This grouping SHOULD be used together with the + eth-label and eth-label-step groupings to provide Ethernet + technology-specific label information to the models which + use the label-restriction-info grouping defined in the module + ietf-te-types."; + + container ethernet-label-range { + presence + "Indicates the label range is an Ethernet label range. + + This container must not be present if there are other + presence containers or attributes indicating another type + of label range."; + description + "Ethernet-specific label range related information."; + + uses etht-types:eth-label-restriction; + } + } + + grouping eth-tran-topology-type { + description + "Identifies the Ethernet Transport topology type"; + + container eth-tran-topology { + presence "indicates a topology type of + Ethernet Transport Network."; + description "Eth transport topology type"; + } + } + + grouping ltp-bandwidth-profiles { + description + "A grouping which represents the bandwidth profile(s) + for the ETH LTP."; + + choice direction { + description + "Whether the bandwidth profiles are symmetrical or + asymmetrical"; + case symmetrical { + description + "The same bandwidth profile is used to describe the ingress + and the egress bandwidth profile."; + + container ingress-egress-bandwidth-profile { + description + "The bandwith profile used in the ingress and egress + direction."; + uses etht-types:etht-bandwidth-profiles; + } + } + case asymmetrical { + description + "Different ingress and egress bandwidth profiles + can be specified."; + container ingress-bandwidth-profile { + description + "The bandwidth profile used in the ingress direction."; + uses etht-types:etht-bandwidth-profiles; + } + container egress-bandwidth-profile { + description + "The bandwidth profile used in the egress direction."; + uses etht-types:etht-bandwidth-profiles; + } + } + } + } + grouping eth-ltp-attributes { + description + "Ethernet transport Link Termination Point (LTP) attributes"; + + leaf ltp-mac-address { + type yang:mac-address; + description + "The MAC address of the Ethernet LTP."; + } + leaf port-vlan-id { + type etht-types:vlanid; + description + "The Port VLAN ID of the Ethernet LTP."; + reference + "IEEE 802.1Q: Virtual Bridged Local Area Networks"; + } + leaf maximum-frame-size { + type uint16 { + range "64 .. 65535"; + } + description + "Maximum frame size"; + reference + "IEEE 802.1Q: Virtual Bridged Local Area Networks"; + } + uses ltp-bandwidth-profiles; + } + + grouping svc-vlan-classification { + description + "Grouping defining the capabilities for VLAN classification."; + + leaf-list supported-tag-types { + type etht-types:eth-tag-classify; + description + "List of VLAN tag types that can be used for the VLAN + classification. In case VLAN classification is not + supported, the list is empty."; + } + leaf vlan-bundling { + type boolean; + description + "In case VLAN classification is supported, indicates whether + VLAN bundling classification is also supported."; + reference + "MEF 10.3: Ethernet Services Attributes Phase 3"; + } + leaf vlan-range { + type etht-types:vid-range-type; + description + "In case VLAN classification is supported, indicates the + of available VLAN ID values."; + } + } + + grouping svc-vlan-push { + description + "Grouping defining the capabilities for VLAN push or swap + operations."; + + leaf-list supported-tag-types { + type etht-types:eth-tag-type; + description + "List of VLAN tag types that can be used to push or swap a + VLAN tag. In case VLAN push/swap is not supported, the list + is empty."; + reference + "IEEE 802.1Q: Virtual Bridged Local Area Networks"; + } + leaf vlan-range { + type etht-types:vid-range-type; + description + "In case VLAN push/swap operation is supported, the range + of available VLAN ID values."; + } + } + + grouping eth-svc-attributes { + description + "Ethernet Link Termination Point (LTP) service attributes."; + + container supported-classification { + description + "Service classification capability supported by the + Ethernet Link Termination Point (LTP)."; + + leaf port-classification { + type boolean; + description + "Indicates that the ETH LTP support port-based service + classification."; + } + container vlan-classification { + description + "Service classification capabilities based on the VLAN + tag(s) supported by the ETH LTP."; + leaf vlan-tag-classification { + type boolean; + description + "Indicates that the ETH LTP supports VLAN service + classification."; + } + container outer-tag { + description + "Service classification capabilities based on the outer + VLAN tag, supported by the ETH LTP."; + uses svc-vlan-classification; + } + container second-tag { + description + "Service classification capabilities based on the second + VLAN tag, supported by the ETH LTP."; + leaf second-tag-classification { + type boolean; + must ". = 'false' or " + + "../../vlan-tag-classification = 'true'" { + description + "VLAN service classification based on the second + VLAN tag can be supported only when VLAN service + classification"; + } + description + "Indicates that the ETH LTP support VLAN service + classification based on the second VLAN tag."; + } + uses svc-vlan-classification; + } + } + } + + container supported-vlan-operations { + description + "Reports the VLAN operations supported by the ETH LTP."; + + leaf asymmetrical-operations { + type boolean; + description + "Indicates whether the ETH LTP supports also asymmetrical + VLAN operations.It is assumed that symmetrical VLAN + operations are alwyas supported."; + } + leaf transparent-vlan-operations { + type boolean; + description + "Indicates that the ETH LTP supports transparent + operations."; + } + container vlan-pop { + description + "Indicates VLAN pop or swap operations capabilities."; + + leaf vlan-pop-operations { + type boolean; + description + "Indicates that the ETH LTP supports VLAN pop or + swap operations."; + } + leaf max-pop-tags { + type uint8 { + range "1..2"; + } + description + "Indicates the maximum number of tags that can be + popped/swapped."; + } + } + container vlan-push { + description + "Indicates VLAN push or swap operations capabilities."; + + leaf vlan-push-operation { + type boolean; + description + "Indicates that the ETH LTP supports VLAN push or + swap operations."; + } + container outer-tag { + description + "Indicates the supported VLAN operation capabilities + on the outer VLAN tag."; + uses svc-vlan-push; + } + container second-tag { + description + "Indicates the supported VLAN operation capabilities + on the second VLAN tag."; + leaf push-second-tag { + type boolean; + description + "Indicates that the ETH LTP supports VLAN push or swap + operations for the second VLAN tag."; + } + uses svc-vlan-push; + } + } + } + } + + /* + * Data nodes + */ + + augment "/nw:networks/nw:network/nw:network-types/" + + "tet:te-topology" { + description + "Augment network types to include ETH transport newtork"; + + uses eth-tran-topology-type; + } + + augment "/nw:networks/nw:network/nw:node/tet:te" + + "/tet:te-node-attributes" { + when "../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description "Augment only for Ethernet transport network."; + } + description "Augment TE node attributes."; + container eth-node { + presence "The TE node is an Ethernet node."; + description + "Presence container used only to indicate that the TE node + is an Ethernet node."; + } + } + + augment "/nw:networks/nw:network/nt:link" { + when "../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description "Augment only for Ethernet transport network."; + } + description "Augment link configuration"; + + container eth-svc { + presence + "When present, indicates that the Link supports Ethernet + client signals."; + description + "Presence container used only to indicate that the link + supports Ethernet client signals."; + } + } + + augment "/nw:networks/nw:network/nw:node/nt:termination-point" { + when "../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description "Augment only for Ethernet transport network."; + } + description + "Augment ETH LTP attributes"; + + container eth-svc { + presence + "When present, indicates that the Link Termination Point + (LTP) supports Ethernet client signals."; + description + "ETH LTP Service attributes."; + + uses eth-svc-attributes; + } + container eth-link-tp { + description + "Attributes of the Ethernet Link Termination Point (LTP)."; + uses eth-ltp-attributes; + } + } + + /* + * Augment TE bandwidth + */ + + augment "/nw:networks/nw:network/nw:node/nt:termination-point/" + + "tet:te/" + + "tet:interface-switching-capability/tet:max-lsp-bandwidth/" + + "tet:te-bandwidth/tet:technology" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment maximum LSP TE bandwidth for the link termination + point (LTP)."; + case eth { + uses etht-types:eth-bandwidth; + } + } + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:path-constraints/tet:te-bandwidth/tet:technology" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE bandwidth path constraints of the TE node + connectivity matrices."; + case eth { + uses etht-types:eth-bandwidth; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:path-constraints/tet:te-bandwidth/tet:technology" { + when "../../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE bandwidth path constraints of the + connectivity matrix entry."; + case eth { + uses etht-types:eth-bandwidth; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:path-constraints/tet:te-bandwidth/tet:technology" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE bandwidth path constraints of the TE node + connectivity matrices information source."; + case eth { + uses etht-types:eth-bandwidth; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:path-constraints/tet:te-bandwidth/tet:technology" { + when "../../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE bandwidth path constraints of the + connectivity matrix entry information source"; + case eth { + uses etht-types:eth-bandwidth; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:client-layer-adaptation/tet:switching-capability/" + + "tet:te-bandwidth/tet:technology" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment client TE bandwidth of the tunnel termination point + (TTP)"; + case eth { + uses etht-types:eth-bandwidth; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/tet:path-constraints/" + + "tet:te-bandwidth/tet:technology" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE bandwidth path constraints for the TTP + Local Link Connectivities."; + case eth { + uses etht-types:eth-bandwidth; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:local-link-connectivity/tet:path-constraints/" + + "tet:te-bandwidth/tet:technology" { + when "../../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE bandwidth path constraints for the TTP + Local Link Connectivity entry."; + case eth { + uses etht-types:eth-bandwidth; + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:te-link-attributes/" + + "tet:interface-switching-capability/tet:max-lsp-bandwidth/" + + "tet:te-bandwidth/tet:technology" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment maximum LSP TE bandwidth for the TE link."; + case eth { + uses etht-types:eth-bandwidth; + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:te-link-attributes/" + + "tet:max-link-bandwidth/" + + "tet:te-bandwidth" { + when "../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment maximum TE bandwidth for the TE link"; + uses etht-types:eth-bandwidth; + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:te-link-attributes/" + + "tet:max-resv-link-bandwidth/" + + "tet:te-bandwidth" { + when "../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment maximum reservable TE bandwidth for the TE link"; + uses etht-types:eth-bandwidth; + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:te-link-attributes/" + + "tet:unreserved-bandwidth/" + + "tet:te-bandwidth" { + when "../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment unreserved TE bandwidth for the TE Link"; + uses etht-types:eth-bandwidth; + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:information-source-entry/" + + "tet:interface-switching-capability/" + + "tet:max-lsp-bandwidth/" + + "tet:te-bandwidth/tet:technology" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment maximum LSP TE bandwidth for the TE link + information source"; + case eth { + uses etht-types:eth-bandwidth; + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:information-source-entry/" + + "tet:max-link-bandwidth/" + + "tet:te-bandwidth" { + when "../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment maximum TE bandwidth for the TE link + information source"; + uses etht-types:eth-bandwidth; + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:information-source-entry/" + + "tet:max-resv-link-bandwidth/" + + "tet:te-bandwidth" { + when "../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment maximum reservable TE bandwidth for the TE link + information-source"; + uses etht-types:eth-bandwidth; + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:information-source-entry/" + + "tet:unreserved-bandwidth/" + + "tet:te-bandwidth" { + when "../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment unreserved TE bandwidth of the TE link + information source"; + uses etht-types:eth-bandwidth; + } + + augment "/nw:networks/tet:te/tet:templates/" + + "tet:link-template/tet:te-link-attributes/" + + "tet:interface-switching-capability/" + + "tet:max-lsp-bandwidth/" + + "tet:te-bandwidth/tet:technology" { + description + "Augment maximum LSP TE bandwidth of the TE link + template"; + case eth { + uses etht-types:eth-bandwidth; + } + } + + augment "/nw:networks/tet:te/tet:templates/" + + "tet:link-template/tet:te-link-attributes/" + + "tet:max-link-bandwidth/" + + "tet:te-bandwidth" { + description + "Augment maximum TE bandwidth the TE link template"; + uses etht-types:eth-bandwidth; + } + + augment "/nw:networks/tet:te/tet:templates/" + + "tet:link-template/tet:te-link-attributes/" + + "tet:max-resv-link-bandwidth/" + + "tet:te-bandwidth" { + description + "Augment maximum reservable TE bandwidth for the TE link + template."; + uses etht-types:eth-bandwidth; + } + + augment "/nw:networks/tet:te/tet:templates/" + + "tet:link-template/tet:te-link-attributes/" + + "tet:unreserved-bandwidth/" + + "tet:te-bandwidth" { + description + "Augment unreserved TE bandwidth the TE link template"; + uses etht-types:eth-bandwidth; + } + + /* + * Augment TE label range information + */ + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:label-restrictions/tet:label-restriction" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range information for the TE node + connectivity matrices."; + uses label-range-info; + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/tet:from/" + + "tet:label-restrictions/tet:label-restriction" { + when "../../../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range information for the source LTP + of the connectivity matrix entry."; + uses label-range-info; + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/tet:to/" + + "tet:label-restrictions/tet:label-restriction" { + when "../../../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range information for the destination LTP + of the connectivity matrix entry."; + uses label-range-info; + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/" + + "tet:connectivity-matrices/tet:label-restrictions/" + + "tet:label-restriction" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range information for the TE node + connectivity matrices information source."; + uses label-range-info; + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:from/tet:label-restrictions/tet:label-restriction" { + when "../../../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range information for the source LTP + of the connectivity matrix entry information source."; + uses label-range-info; + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:to/tet:label-restrictions/tet:label-restriction" { + when "../../../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range information for the destination LTP + of the connectivity matrix entry information source."; + uses label-range-info; + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:label-restrictions/tet:label-restriction" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range information for the TTP + Local Link Connectivities."; + uses label-range-info; + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:local-link-connectivity/" + + "tet:label-restrictions/tet:label-restriction" { + when "../../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range information for the TTP + Local Link Connectivity entry."; + uses label-range-info; + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:te-link-attributes/" + + "tet:label-restrictions/tet:label-restriction" { + when "../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range information for the TE link."; + uses label-range-info; + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:information-source-entry/" + + "tet:label-restrictions/tet:label-restriction" { + when "../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range information for the TE link + information source."; + uses label-range-info; + } + + augment "/nw:networks/tet:te/tet:templates/" + + "tet:link-template/tet:te-link-attributes/" + + "tet:label-restrictions/tet:label-restriction" { + description + "Augment TE label range information for the TE link template."; + uses label-range-info; + } + + /* + * Augment TE label. + */ + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-start/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range start for the TE node + connectivity matrices"; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:label-restrictions/" + + "tet:label-restriction/tet:label-end/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range end for the TE node + connectivity matrices"; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:label-restrictions/" + + "tet:label-restriction/tet:label-step/" + + "tet:technology" { + when "../../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range step for the TE node + connectivity matrices"; + case eth { + uses etht-types:eth-label-step; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:underlay/tet:primary-path/tet:path-element/" + + "tet:type/tet:label/tet:label-hop/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the underlay primary path of the + TE node connectivity matrices"; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:underlay/tet:backup-path/tet:path-element/" + + "tet:type/tet:label/tet:label-hop/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the underlay backup path of the + TE node connectivity matrices"; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:optimizations/tet:algorithm/tet:metric/" + + "tet:optimization-metric/" + + "tet:explicit-route-exclude-objects/" + + "tet:route-object-exclude-object/" + + "tet:type/tet:label/tet:label-hop/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the explicit route objects excluded + by the path computation of the TE node connectivity + matrices"; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:optimizations/tet:algorithm/tet:metric/" + + "tet:optimization-metric/" + + "tet:explicit-route-include-objects/" + + "tet:route-object-include-object/" + + "tet:type/tet:label/tet:label-hop/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the explicit route objects included + by the path computation of the TE node connectivity + matrices"; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:path-properties/tet:path-route-objects/" + + "tet:path-route-object/tet:type/tet:label/tet:label-hop/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the computed path route objects + of the TE node connectivity matrices"; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/tet:from/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-start/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range start for the source LTP + of the connectivity matrix entry."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/tet:from/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-end/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range end for the source LTP + of the connectivity matrix entry."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/tet:from/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-step/" + + "tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range step for the source LTP + of the connectivity matrix entry."; + case eth { + uses etht-types:eth-label-step; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/tet:to/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-start/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range start for the destination LTP + of the connectivity matrix entry."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/tet:to/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-end/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range end for the destination LTP + of the connectivity matrix entry."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/tet:to/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-step/" + + "tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range step for the destination LTP + of the connectivity matrix entry."; + case eth { + uses etht-types:eth-label-step; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:underlay/tet:primary-path/tet:path-element/" + + "tet:type/tet:label/tet:label-hop/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the underlay primary path + of the connectivity matrix entry."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:underlay/tet:backup-path/tet:path-element/" + + "tet:type/tet:label/tet:label-hop/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the underlay backup path + of the connectivity matrix entry."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/tet:optimizations/" + + "tet:algorithm/tet:metric/tet:optimization-metric/" + + "tet:explicit-route-exclude-objects/" + + "tet:route-object-exclude-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the explicit route objects excluded + by the path computation of the connectivity matrix entry."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/tet:optimizations/" + + "tet:algorithm/tet:metric/tet:optimization-metric/" + + "tet:explicit-route-include-objects/" + + "tet:route-object-include-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the explicit route objects included + by the path computation of the connectivity matrix entry."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:path-properties/tet:path-route-objects/" + + "tet:path-route-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the computed path route objects + of the connectivity matrix entry."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/" + + "tet:connectivity-matrices/tet:label-restrictions/" + + "tet:label-restriction/" + + "tet:label-start/tet:te-label/tet:technology" { + when "../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range start for the TE node connectivity + matrices information source."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/" + + "tet:connectivity-matrices/tet:label-restrictions/" + + "tet:label-restriction/" + + "tet:label-end/tet:te-label/tet:technology" { + when "../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range end for the TE node connectivity + matrices information source."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/" + + "tet:connectivity-matrices/tet:label-restrictions/" + + "tet:label-restriction/" + + "tet:label-step/tet:technology" { + when "../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range step for the TE node connectivity + matrices information source."; + case eth { + uses etht-types:eth-label-step; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:underlay/tet:primary-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the underlay primary path + of the TE node connectivity matrices of the information + source entry."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:underlay/tet:backup-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the underlay backup path + of the TE node connectivity matrices of the information + source entry."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:optimizations/tet:algorithm/tet:metric/" + + "tet:optimization-metric/" + + "tet:explicit-route-exclude-objects/" + + "tet:route-object-exclude-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the explicit route objects excluded + by the path computation of the TE node connectivity matrices + information source."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:optimizations/tet:algorithm/tet:metric/" + + "tet:optimization-metric/" + + "tet:explicit-route-include-objects/" + + "tet:route-object-include-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the explicit route objects included + by the path computation of the TE node connectivity matrices + information source."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:path-properties/tet:path-route-objects/" + + "tet:path-route-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the computed path route objects + of the TE node connectivity matrices information source."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:from/tet:label-restrictions/" + + "tet:label-restriction/" + + "tet:label-start/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range start for the source LTP + of the connectivity matrix entry information source."; + case eth { + uses etht-types:eth-label; + } + } + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:from/tet:label-restrictions/" + + "tet:label-restriction/" + + "tet:label-end/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range end for the source LTP + of the connectivity matrix entry information source."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:from/tet:label-restrictions/" + + "tet:label-restriction/" + + "tet:label-step/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range step for the source LTP + of the connectivity matrix entry information source."; + case eth { + uses etht-types:eth-label-step; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:to/tet:label-restrictions/tet:label-restriction/" + + "tet:label-start/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range start for the destination LTP + of the connectivity matrix entry information source."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:to/tet:label-restrictions/tet:label-restriction/" + + "tet:label-end/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range end for the destination LTP + of the connectivity matrix entry information source."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:to/tet:label-restrictions/tet:label-restriction/" + + "tet:label-step/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range step for the destination LTP + of the connectivity matrix entry information source."; + case eth { + uses etht-types:eth-label-step; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:underlay/tet:primary-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the underlay primary path + of the connectivity matrix entry information source."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:underlay/tet:backup-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the underlay backup path + of the connectivity matrix entry information source."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:optimizations/tet:algorithm/tet:metric/" + + "tet:optimization-metric/" + + "tet:explicit-route-exclude-objects/" + + "tet:route-object-exclude-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the explicit route objects excluded + by the path computation of the connectivity matrix entry + information source."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:optimizations/tet:algorithm/tet:metric/" + + "tet:optimization-metric/" + + "tet:explicit-route-include-objects/" + + "tet:route-object-include-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the explicit route objects included + by the path computation of the connectivity matrix entry + information source."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix/" + + "tet:path-properties/tet:path-route-objects/" + + "tet:path-route-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the computed path route objects + of the connectivity matrix entry information source."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-start/" + + "tet:te-label/tet:technology" { + when "../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range start for the TTP + Local Link Connectivities."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-end/" + + "tet:te-label/tet:technology"{ + when "../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range end for the TTP + Local Link Connectivities."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-step/" + + "tet:technology"{ + when "../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range step for the TTP + Local Link Connectivities."; + case eth { + uses etht-types:eth-label-step; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:underlay/tet:primary-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the underlay primary path + of the TTP Local Link Connectivities."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:underlay/tet:backup-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the underlay backup path + of the TTP Local Link Connectivities."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:optimizations/tet:algorithm/tet:metric/" + + "tet:optimization-metric/" + + "tet:explicit-route-exclude-objects/" + + "tet:route-object-exclude-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the explicit route objects excluded + by the path computation of the TTP Local Link + Connectivities."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:optimizations/tet:algorithm/tet:metric/" + + "tet:optimization-metric/" + + "tet:explicit-route-include-objects/" + + "tet:route-object-include-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the explicit route objects included + by the path computation of the TTP Local Link + Connectivities."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:path-properties/tet:path-route-objects/" + + "tet:path-route-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the computed path route objects + of the TTP Local Link Connectivities."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:local-link-connectivity/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-start/tet:te-label/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range start for the TTP + Local Link Connectivity entry."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:local-link-connectivity/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-end/tet:te-label/tet:technology" { + when "../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range end for the TTP + Local Link Connectivity entry."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:local-link-connectivity/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-step/tet:technology" { + when "../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range step for the TTP + Local Link Connectivity entry."; + case eth { + uses etht-types:eth-label-step; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:local-link-connectivity/" + + "tet:underlay/tet:primary-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the underlay primary path + of the TTP Local Link Connectivity entry."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:local-link-connectivity/" + + "tet:underlay/tet:backup-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the underlay backup path + of the TTP Local Link Connectivity entry."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:local-link-connectivity/" + + "tet:optimizations/tet:algorithm/tet:metric/" + + "tet:optimization-metric/" + + "tet:explicit-route-exclude-objects/" + + "tet:route-object-exclude-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the explicit route objects excluded + by the path computation of the TTP Local Link + Connectivity entry."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:local-link-connectivity/" + + "tet:optimizations/tet:algorithm/tet:metric/" + + "tet:optimization-metric/" + + "tet:explicit-route-include-objects/" + + "tet:route-object-include-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the explicit route objects included + by the path computation of the TTP Local Link + Connectivity entry."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:local-link-connectivity/" + + "tet:path-properties/tet:path-route-objects/" + + "tet:path-route-object/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the computed path route objects + of the TTP Local Link Connectivity entry."; + case eth { + uses etht-types:eth-label; + } + } + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:te-link-attributes/" + + "tet:underlay/tet:primary-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the underlay primary path + of the TE link."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:te-link-attributes/" + + "tet:underlay/tet:backup-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + when "../../../../../../../../" + + "nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label hop for the underlay backup path + of the TE link."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:te-link-attributes/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-start/tet:te-label/tet:technology" { + when "../../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range start for the TE link."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:te-link-attributes/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-end/tet:te-label/tet:technology" { + when "../../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range end for the TE link."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:te-link-attributes/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-step/tet:technology" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range step for the TE link."; + case eth { + uses etht-types:eth-label-step; + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:information-source-entry/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-start/tet:te-label/tet:technology" { + when "../../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range start for the TE link + information source."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:information-source-entry/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-end/tet:te-label/tet:technology" { + when "../../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range end for the TE link + information source."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te/" + + "tet:information-source-entry/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-step/tet:technology" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "etht:eth-tran-topology" { + description + "Augmentation parameters apply only for networks with + Ethernet topology type."; + } + description + "Augment TE label range step for the TE link + information source."; + case eth { + uses etht-types:eth-label-step; + } + } + + augment "/nw:networks/tet:te/tet:templates/" + + "tet:link-template/tet:te-link-attributes/" + + "tet:underlay/tet:primary-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + description + "Augment TE label hop for the underlay primary path + of the TE link template."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/tet:te/tet:templates/" + + "tet:link-template/tet:te-link-attributes/" + + "tet:underlay/tet:backup-path/tet:path-element/tet:type/" + + "tet:label/tet:label-hop/tet:te-label/tet:technology" { + description + "Augment TE label hop for the underlay backup path + of the TE link template."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/tet:te/tet:templates/" + + "tet:link-template/tet:te-link-attributes/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-start/tet:te-label/tet:technology" { + description + "Augment TE label range start for the TE link template."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/tet:te/tet:templates/" + + "tet:link-template/tet:te-link-attributes/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-end/tet:te-label/tet:technology" { + description + "Augment TE label range end for the TE link template."; + case eth { + uses etht-types:eth-label; + } + } + + augment "/nw:networks/tet:te/tet:templates/" + + "tet:link-template/tet:te-link-attributes/" + + "tet:label-restrictions/tet:label-restriction/" + + "tet:label-step/tet:technology" { + description + "Augment TE label range step for the TE link template."; + case eth { + uses etht-types:eth-label-step; + } + } + + } diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-eth-tran-service@2023-10-23.yang b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-eth-tran-service@2023-10-23.yang new file mode 100644 index 000000000..222066adf --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-eth-tran-service@2023-10-23.yang @@ -0,0 +1,1004 @@ + module ietf-eth-tran-service { + yang-version 1.1; + namespace "urn:ietf:params:xml:ns:yang:ietf-eth-tran-service"; + + prefix "ethtsvc"; + import ietf-yang-types { + prefix "yang"; + reference "RFC 6991 - Common YANG Data Types"; + } + + import ietf-network { + prefix "nw"; + reference "RFC8345 - A YANG Data Model for Network Topologies"; + } + + import ietf-network-topology { + prefix "nt"; + reference "RFC8345 - A YANG Data Model for Network Topologies"; + } + + import ietf-te-types { + prefix "te-types"; + reference "RFC 8776 - Traffic Engineering Common YANG Types"; + } + + import ietf-eth-tran-types { + prefix "etht-types"; + reference "RFC XXXX - A YANG Data Model for Transport + Network Client Signals"; + } + + import ietf-routing-types { + prefix "rt-types"; + reference "RFC 8294 - Common YANG Data Types for the + Routing Area"; + + } + + import ietf-te { + prefix "te"; + reference "RFC YYYY - A YANG Data Model for Traffic + Engineering Tunnels and Interfaces"; + } + + organization + "Internet Engineering Task Force (IETF) CCAMP WG"; + contact + " + WG List: + + ID-draft editor: + Haomian Zheng (zhenghaomian@huawei.com); + Italo Busi (italo.busi@huawei.com); + Aihua Guo (aihuaguo.ietf@gmail.com); + Anton Snitser (antons@sedonasys.com);0 + Francesco Lazzeri (francesco.lazzeri@ericsson.com); + Yunbin Xu (xuyunbin@caict.ac.cn); + Yang Zhao (zhaoyangyjy@chinamobile.com); + Xufeng Liu (xufeng.liu.ietf@gmail.com); + Giuseppe Fioccola (giuseppe.fioccola@huawei.com); + Chaode Yu (yuchaode@huawei.com) + "; + + description + "This module defines a YANG data model for describing + the Ethernet services. The model fully conforms to the + Network Management Datastore Architecture (NMDA). + + Copyright (c) 2021 IETF Trust and the persons + identified as authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (https://trustee.ietf.org/license-info). + This version of this YANG module is part of RFC XXXX; see + the RFC itself for full legal notices."; + + revision 2023-10-23 { + description + "version -04 as an WG document"; + reference + "draft-ietf-ccamp-client-signal-yang"; + } + + /* + * Groupings + */ + + grouping vlan-classification { + description + "A grouping which represents classification + on an 802.1Q VLAN tag."; + + leaf tag-type { + type etht-types:eth-tag-classify; + description + "The tag type used for VLAN classification."; + } + choice individual-bundling-vlan { + description + "VLAN based classification can be individual + or bundling."; + + case individual-vlan { + leaf vlan-value { + type etht-types:vlanid; + description + "VLAN ID value."; + } + } + + case vlan-bundling { + leaf vlan-range { + type etht-types:vid-range-type; + description + "List of VLAN ID values."; + } + } + } + } + + grouping vlan-write { + description + "A grouping which represents push/pop operations + of an 802.1Q VLAN tag."; + + leaf tag-type { + type etht-types:eth-tag-type; + description + "The VLAN tag type to push/swap."; + } + leaf vlan-value { + type etht-types:vlanid; + description + "The VLAN ID value to push/swap."; + } + /* + * To be added: this attribute is used when: + * a) the ETH service has only one CoS (as in current version) + * b) as a default when a mapping between a given CoS value + * and the PCP value is not defined (in future versions) + */ + leaf default-pcp { + type uint8 { + range "0..7"; + } + description + "The default Priority Code Point (PCP) value to push/swap"; + } + } + + grouping vlan-operations { + description + "A grouping which represents VLAN operations."; + + leaf pop-tags { + type uint8 { + range "1..2"; + } + description + "The number of VLAN tags to pop (or swap if used in + conjunction with push-tags)"; + } + container push-tags { + description + "The VLAN tags to push (or swap if used in + conjunction with pop-tags)"; + + container outer-tag { + presence + "Indicates existence of the outermost VLAN tag to + push/swap"; + + description + "The outermost VLAN tag to push/swap."; + + uses vlan-write; + } + container second-tag { + must + '../outer-tag/tag-type = "etht-types:s-vlan-tag-type" and ' + + 'tag-type = "etht-types:c-vlan-tag-type"' + { + + error-message + " + When pushing/swapping two tags, the outermost tag must + be specified and of S-VLAN type and the second + outermost tag must be of C-VLAN tag type. + "; + description + " + For IEEE 802.1Q interoperability, when pushing/swapping + two tags, it is required that the outermost tag exists + and is an S-VLAN, and the second outermost tag is a + C-VLAN. + "; + } + + presence + "Indicates existence of a second outermost VLAN tag to + push/swap"; + + description + "The second outermost VLAN tag to push/swap."; + uses vlan-write; + } + } + } + + grouping named-or-value-bandwidth-profile { + description + "A grouping to configure a bandwdith profile either by + referencing a named bandwidth profile or by + configuring the values of the bandwidth profile attributes."; + choice style { + description + "Whether the bandwidth profile is named or defined by value"; + + case named { + description + "Named bandwidth profile."; + leaf bandwidth-profile-name { + type leafref { + path "/ethtsvc:etht-svc/ethtsvc:globals/" + + "ethtsvc:named-bandwidth-profiles/" + + "ethtsvc:bandwidth-profile-name"; + } + description + "Name of the bandwidth profile."; + } + } + case value { + description + "Bandwidth profile configured by value."; + uses etht-types:etht-bandwidth-profiles; + } + } + } + + grouping bandwidth-profiles { + description + "A grouping which represent bandwidth profile configuration."; + + choice direction { + description + "Whether the bandwidth profiles are symmetrical or + asymmetrical"; + case symmetrical { + description + "The same bandwidth profile is used to describe both + the ingress and the egress bandwidth profile."; + container ingress-egress-bandwidth-profile { + description + "The bandwdith profile used in both directions."; + uses named-or-value-bandwidth-profile; + } + } + case asymmetrical { + description + "Ingress and egress bandwidth profiles can be specified."; + container ingress-bandwidth-profile { + description + "The bandwdith profile used in the ingress direction."; + uses named-or-value-bandwidth-profile; + } + container egress-bandwidth-profile { + description + "The bandwdith profile used in the egress direction."; + uses named-or-value-bandwidth-profile; + } + } + } + } + + grouping etht-svc-access-parameters { + description + "ETH services access parameters"; + + leaf access-node-id { + type te-types:te-node-id; + description + "The identifier of the access node in + the ETH TE topology."; + } + + leaf access-node-uri { + type nw:node-id; + description + "The identifier of the access node in the network."; + } + + leaf access-ltp-id { + type te-types:te-tp-id; + description + "The TE link termination point identifier, used + together with access-node-id to identify the + access LTP."; + } + + leaf access-ltp-uri { + type nt:tp-id; + description + "The link termination point identifier in network topology, + used together with access-node-uri to identify the + access LTP."; + } + + leaf access-role { + type identityref { + base etht-types:access-role; + } + description + "Indicate the role of access, e.g., working or protection. "; + } + + container pm-config { + uses pm-config-grouping; + description + "This grouping is used to set the threshold value for + performance monitoring. "; + } + + container state { + config false; + description + "The state is used to monitor the status of service. "; + leaf operational-state { + type identityref { + base te-types:tunnel-state-type; + } + description + "Indicating the operational state of client signal. "; + } + leaf provisioning-state { + type identityref { + base te-types:lsp-state-type; + } + description + "Indicating the provisional state of client signal, + especially when there is a change, i.e., revise, create. "; + } + } + + leaf performance { + type identityref { + base etht-types:performance; + } + config false; + description + "Performance Monitoring for the service. "; + } + + } + + grouping etht-svc-tunnel-parameters { + description + "ETH services tunnel parameters."; + choice technology { + description + "Service multiplexing is optional and flexible."; + + case native-ethernet { + /* + placeholder to support proprietary multiplexing + (for further discussion) + */ + list eth-tunnels { + key name; + description + "ETH Tunnel list in native Ethernet scenario."; + uses tunnels-grouping; + } + } + + case frame-base { + list otn-tunnels { + key name; + description + "OTN Tunnel list in Frame-based scenario."; + uses tunnels-grouping; + } + } + + case mpls-tp { + container pw { + description + "Pseudowire information for Ethernet over MPLS-TP."; + uses pw-segment-grouping; + } + } + } + + /* + * Open issue: can we constraints it to be used only with mp services? + */ + leaf src-split-horizon-group { + type string; + description + "Identify a split horizon group at the Tunnel source TTP"; + } + leaf dst-split-horizon-group { + type string; + description + "Identify a split horizon group at the Tunnel destination TTP"; + } + } + + grouping etht-svc-pm-threshold-config { + description + "Configuraiton parameters for Ethernet service PM thresholds."; + + leaf sending-rate-high { + type uint64; + description + "High threshold of packet sending rate in kbps."; + } + leaf sending-rate-low { + type uint64; + description + "Low threshold of packet sending rate in kbps."; + } + leaf receiving-rate-high { + type uint64; + description + "High threshold of packet receiving rate in kbps."; + } + leaf receiving-rate-low { + type uint64; + description + "Low threshold of packet receiving rate in kbps."; + } + } + + grouping etht-svc-pm-stats { + description + "Ethernet service PM statistics."; + + leaf sending-rate-too-high { + type uint32; + description + "Counter that indicates the number of times the + sending rate is above the high threshold"; + } + leaf sending-rate-too-low { + type uint32; + description + "Counter that indicates the number of times the + sending rate is below the low threshold"; + } + leaf receiving-rate-too-high { + type uint32; + description + "Counter that indicates the number of times the + receiving rate is above the high threshold"; + } + leaf receiving-rate-too-low { + type uint32; + description + "Counter that indicates the number of times the + receiving rate is below the low threshold"; + } + } + + grouping etht-svc-instance-config { + description + "Configuraiton parameters for Ethernet services."; + + leaf etht-svc-name { + type string; + description + "Name of the ETH service."; + } + + leaf etht-svc-title { + type string; + description + "The Identifier of the ETH service."; + } + + leaf user-label { + type string; + description + "Alias of the ETH service."; + } + + leaf etht-svc-descr { + type string; + description + "Description of the ETH service."; + } + + leaf etht-svc-customer { + type string; + description + "Customer of the ETH service."; + } + + leaf etht-svc-type { + type etht-types:service-type; + description + "Type of ETH service (p2p, mp2mp or rmp)."; + /* Add default as p2p */ + } + + leaf etht-svc-lifecycle { + type etht-types:lifecycle-status; + description + "Lifecycle state of ETH service."; + /* Add default as installed */ + } + uses te-types:te-topology-identifier; + + uses resilience-grouping; + list etht-svc-end-points { + key etht-svc-end-point-name; + description + "The logical end point for the ETH service. "; + uses etht-svc-end-point-grouping; + } + + container alarm-shreshold { + description "threshold configuration for the E2E client signal"; + uses alarm-shreshold-grouping; + } + + container underlay { + description + "The unterlay tunnel information that carrying the + ETH service. "; + uses etht-svc-tunnel-parameters; + } + + leaf admin-status { + type identityref { + base te-types:tunnel-admin-state-type; + } + default te-types:tunnel-admin-state-up; + description "ETH service administrative state."; + } + } + + grouping etht-svc-instance-state { + description + "State parameters for Ethernet services."; + + leaf operational-state { + type identityref { + base te-types:tunnel-state-type; + } + default te-types:tunnel-state-up; + description "ETH service operational state."; + } + leaf provisioning-state { + type identityref { + base te-types:lsp-state-type; + } + description "ETH service provisioning state."; + } + leaf creation-time { + type yang:date-and-time; + description + "Time of ETH service creation."; + } + leaf last-updated-time { + type yang:date-and-time; + description + "Time of ETH service last update."; + } + + leaf created-by { + type string; + description + "The client signal is created by whom, + can be a system or staff ID."; + } + leaf last-updated-by { + type string; + description + "The client signal is last updated by whom, + can be a system or staff ID."; + } + leaf owned-by { + type string; + description + "The client signal is last updated by whom, + can be a system ID."; + } + container pm-state { + description + "PM data of E2E Ethernet service"; + uses pm-state-grouping; + } + container error-info { + description "error messages of configuration"; + uses error-info-grouping; + } + } + + grouping pm-state-grouping { + leaf latency { + description + "latency value of the E2E Ethernet service"; + type uint32; + units microsecond; + } + } + + grouping error-info-grouping { + leaf error-code { + description "error code"; + type uint16; + } + + leaf error-description { + description "detail message of error"; + type string; + } + + leaf error-timestamp { + description "the date and time error is happened"; + type yang:date-and-time; + } + } + + grouping alarm-shreshold-grouping { + leaf latency-threshold { + description "a threshold for the E2E client signal service's + latency. Once the latency value exceed this threshold, an alarm + should be triggered."; + type uint32; + units microsecond; + } + } + + /* + * Data nodes + */ + + container etht-svc { + description + "ETH services."; + + container globals { + description + "Globals Ethernet configuration data container"; + list named-bandwidth-profiles { + key bandwidth-profile-name; + description + "List of named bandwidth profiles used by + Ethernet services."; + + leaf bandwidth-profile-name { + type string; + description + "Name of the bandwidth profile."; + } + uses etht-types:etht-bandwidth-profiles; + } + } + list etht-svc-instances { + key etht-svc-name; + description + "The list of p2p ETH service instances"; + + uses etht-svc-instance-config; + + container state { + config false; + description + "Ethernet Service states."; + + uses etht-svc-instance-state; + } + } + } + + grouping resilience-grouping { + description + "Grouping for resilience configuration. "; + container resilience { + description + "To configure the data plane protection parameters, + currently a placeholder only, future candidate attributes + include, Revert, WTR, Hold-off Timer, ..."; + uses te:protection-restoration-properties; + } + } + + grouping etht-svc-end-point-grouping { + description + "Grouping for the end point configuration."; + leaf etht-svc-end-point-name { + type string; + description + "The name of the logical end point of ETH service. "; + } + + leaf etht-svc-end-point-id { + type string; + description + "The identifier of the logical end point of ETH service."; + } + + leaf etht-svc-end-point-descr { + type string; + description + "The description of the logical end point of ETH service. "; + } + + leaf topology-role { + type identityref { + base etht-types:topology-role; + } + description + "Indicating the underlay topology role, + e.g., hub,spoke, any-to-any "; + } + + container resilience { + description + "Placeholder for resilience configuration, for future study. "; + } + + list etht-svc-access-points { + key access-point-id; + min-elements "1"; + /* + Open Issue: + Is it possible to limit the max-elements only for p2p services? + max-elements "2"; + */ + description + "List of the ETH trasport services access point instances."; + + leaf access-point-id { + type string; + description + "ID of the service access point instance"; + } + uses etht-svc-access-parameters; + } + + leaf service-classification-type { + type identityref { + base etht-types:service-classification-type; + } + description + "Service classification type."; + } + + choice service-classification { + description + "Access classification can be port-based or + VLAN based."; + case port-classification { + /* no additional information */ + } + + case vlan-classification { + container outer-tag { + presence "The outermost VLAN tag exists"; + description + "Classifies traffic using the outermost VLAN tag."; + + uses vlan-classification; + } + container second-tag { + must + '../outer-tag/tag-type = "etht-types:classify-s-vlan" and ' + + 'tag-type = "etht-types:classify-c-vlan"' + { + error-message + " + When matching two tags, the outermost tag must be + specified and of S-VLAN type and the second + outermost tag must be of C-VLAN tag type. + "; + description + " + For IEEE 802.1Q interoperability, when matching two + tags, it is required that the outermost tag exists + and is an S-VLAN, and the second outermost tag is a + C-VLAN. + "; + } + presence "The second outermost VLAN tag exists"; + + description + "Classifies traffic using the second outermost VLAN tag."; + + uses vlan-classification; + } + } + } + + /* + * Open issue: can we constraints it to be used only with mp services? + */ + leaf split-horizon-group { + type string; + description "Identify a split horizon group"; + } + uses bandwidth-profiles; + + container vlan-operations { + description + "Configuration of VLAN operations."; + choice direction { + description + "Whether the VLAN operations are symmetrical or + asymmetrical"; + case symmetrical { + container symmetrical-operation { + uses vlan-operations; + description + "Symmetrical operations. + Expressed in the ingress direction, but + the reverse operation is applied to egress traffic"; + } + } + case asymmetrical { + container asymmetrical-operation { + description "Asymmetrical operations"; + container ingress { + uses vlan-operations; + description "Ingress operations"; + } + container egress { + uses vlan-operations; + description "Egress operations"; + } + } + } + } + } + } + + grouping pm-config-grouping { + description + "Grouping used for Performance Monitoring Configuration. "; + leaf pm-enable { + type boolean; + description + "Whether to enable the performance monitoring."; + } + + leaf sending-rate-high { + type uint64; + description + "The upperbound of sending rate."; + } + + leaf sending-rate-low { + type uint64; + description + "The lowerbound of sending rate."; + } + + leaf receiving-rate-high { + type uint64; + description + "The upperbound of receiving rate."; + } + + leaf receiving-rate-low { + type uint64; + description + "The lowerbound of receiving rate."; + } + } + + grouping pw-segment-grouping { + description + "Grouping used for PW configuration. "; + leaf pw-id { + type string; + description + "The Identifier information of pseudowire. "; + } + + leaf pw-name { + type string; + description + "The name information of pseudowire."; + } + + leaf transmit-label { + type rt-types:mpls-label; + description + "Transmit label information in PW. "; + } + + leaf receive-label { + type rt-types:mpls-label; + description + "Receive label information in PW. "; + } + leaf encapsulation-type { + type identityref { + base etht-types:encapsulation-type; + } + description + "The encapsulation type, raw or tag. "; + } + + leaf oper-status { + type identityref { + base te-types:tunnel-state-type; + } + config false; + description + "The operational state of the PW segment. "; + } + + container ingress-bandwidth-profile { + description + "Bandwidth Profile for ingress. "; + uses pw-segment-named-or-value-bandwidth-profile; + } + + list pw-paths { + key path-id; + description + "A list of pw paths. "; + + leaf path-id { + type uint8; + description + "The identifier of pw paths. "; + + } + + list tp-tunnels { + key name; + description + "Names of TP Tunnel underlay"; + leaf name { + type string; + description + "Names of TP Tunnel underlay"; + } + } + } + + } + grouping pw-segment-named-or-value-bandwidth-profile { + description + "A grouping to configure a bandwdith profile either by + referencing a named bandwidth profile or by + configuring the values of the bandwidth profile attributes."; + choice style { + description + "Whether the bandwidth profile is named or defined by value"; + case named { + description + "Named bandwidth profile."; + leaf bandwidth-profile-name { + type leafref { + path "/ethtsvc:etht-svc/ethtsvc:globals/" + + "ethtsvc:named-bandwidth-profiles/" + + "ethtsvc:bandwidth-profile-name"; + } + description + "Name of the bandwidth profile."; + } + } + case value { + description + "Bandwidth profile configured by value."; + uses etht-types:pw-segement-bandwidth-profile-grouping; + } + } + } + + grouping tunnels-grouping { + description + "A group of tunnels. "; + leaf name { + type leafref { + path "/te:te/te:tunnels/te:tunnel/te:name"; + require-instance false; + } + description "Dependency tunnel name"; + } + leaf encoding { + type identityref { + base te-types:lsp-encoding-types; + } + description "LSP encoding type"; + reference "RFC3945"; + } + leaf switching-type { + type identityref { + base te-types:switching-capabilities; + } + description "LSP switching type"; + reference "RFC3945"; + } + } + } diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-eth-tran-types@2023-10-23.yang b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-eth-tran-types@2023-10-23.yang new file mode 100644 index 000000000..f46908b34 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-eth-tran-types@2023-10-23.yang @@ -0,0 +1,457 @@ + module ietf-eth-tran-types { + yang-version 1.1; + namespace "urn:ietf:params:xml:ns:yang:ietf-eth-tran-types"; + + prefix "etht-types"; + + organization + "Internet Engineering Task Force (IETF) CCAMP WG"; + contact + " + WG List: + + ID-draft editor: + Haomian Zheng (zhenghaomian@huawei.com); + Italo Busi (italo.busi@huawei.com); + Aihua Guo (aihuaguo.ietf@gmail.com); + Anton Snitser (antons@sedonasys.com); + Francesco Lazzeri (francesco.lazzeri@ericsson.com); + Yunbin Xu (xuyunbin@caict.ac.cn); + Yang Zhao (zhaoyangyjy@chinamobile.com); + Xufeng Liu (xufeng.liu.ietf@gmail.com); + Giuseppe Fioccola (giuseppe.fioccola@huawei.com); + Chaode Yu (yuchaode@huawei.com) + "; + + description + "This module defines the ETH types. + The model fully conforms to the Network Management + Datastore Architecture (NMDA). + + Copyright (c) 2019 IETF Trust and the persons + identified as authors of the code. All rights reserved. + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (https://trustee.ietf.org/license-info). + This version of this YANG module is part of RFC XXXX; see + the RFC itself for full legal notices."; + + revision 2023-10-23 { + description + "version -05 as a WG draft"; + reference + "draft-ietf-ccamp-client-signal-yang"; + } + + /* + * Identities + */ + + identity eth-vlan-tag-type { + description + "ETH VLAN tag type."; + } + + identity c-vlan-tag-type { + base eth-vlan-tag-type; + description + "802.1Q Customer VLAN"; + } + + identity s-vlan-tag-type { + base eth-vlan-tag-type; + description + "802.1Q Service VLAN (QinQ)"; + } + + identity service-classification-type { + description + "Service classification."; + } + + identity port-classification { + base service-classification-type; + description + "Port classification."; + } + identity vlan-classification { + base service-classification-type; + description + "VLAN classification."; + } + + identity eth-vlan-tag-classify { + description + "VLAN tag classification."; + } + + identity classify-c-vlan { + base eth-vlan-tag-classify; + description + "Classify 802.1Q Customer VLAN tag. + Only C-tag type is accepted"; + } + + identity classify-s-vlan { + base eth-vlan-tag-classify; + description + "Classify 802.1Q Service VLAN (QinQ) tag. + Only S-tag type is accepted"; + } + + identity classify-s-or-c-vlan { + base eth-vlan-tag-classify; + description + "Classify S-VLAN or C-VLAN tag-classify. + Either tag is accepted"; + } + + identity bandwidth-profile-type-ir { + description + "Bandwidth Profile Types"; + } + + identity mef-10-bwp { + base bandwidth-profile-type-ir; + description + "MEF 10 Bandwidth Profile"; + } + + identity rfc-2697-bwp { + base bandwidth-profile-type-ir; + description + "RFC 2697 Bandwidth Profile"; + } + identity rfc-2698-bwp { + base bandwidth-profile-type-ir; + description + "RFC 2698 Bandwidth Profile"; + } + + identity rfc-4115-bwp { + base bandwidth-profile-type-ir; + description + "RFC 4115 Bandwidth Profile"; + } + + identity service-type-ir { + description + "Type of Ethernet service."; + } + + identity p2p-svc { + base service-type-ir; + description + "Ethernet point-to-point service (EPL, EVPL)."; + } + + identity rmp-svc { + base service-type-ir; + description + "Ethernet rooted-multitpoint service (E-TREE, EP-TREE)."; + } + + identity mp2mp-svc { + base service-type-ir; + description + "Ethernet multipoint-to-multitpoint service (E-LAN, EP-LAN)."; + } + + identity lifecycle-status-ir { + description + "Lifecycle Status."; + } + + identity installed { + base lifecycle-status-ir; + description + "Installed."; + } + + identity planned { + base lifecycle-status-ir; + description + "Planned."; + } + + identity pending-removal { + base lifecycle-status-ir; + description + "Pending Removal."; + } + + /* + * Type Definitions + */ + + typedef eth-tag-type { + type identityref { + base eth-vlan-tag-type; + } + description + "Identifies a specific ETH VLAN tag type."; + } + + typedef eth-tag-classify { + type identityref { + base eth-vlan-tag-classify; + } + description + "Identifies a specific VLAN tag classification."; + } + + typedef vlanid { + type uint16 { + range "1..4094"; + } + description + "The 12-bit VLAN-ID used in the VLAN Tag header."; + } + + typedef vid-range-type { + type string { + pattern "([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?" + + "(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)"; + } + description + "A list of VLAN Ids, or non overlapping VLAN ranges, in + ascending order, between 1 and 4094. + This type is used to match an ordered list of VLAN Ids, or + contiguous ranges of VLAN Ids. Valid VLAN Ids must be in the + range 1 to 4094, and included in the list in non overlapping + ascending order. + + For example: 1,10-100,50,500-1000"; + } + + typedef bandwidth-profile-type { + type identityref { + base bandwidth-profile-type-ir; + } + description + "Identifies a specific Bandwidth Profile type."; + } + + typedef service-type { + type identityref { + base service-type-ir; + } + description + "Identifies the type of Ethernet service."; + } + + typedef lifecycle-status { + type identityref { + base lifecycle-status-ir; + } + description + "Identifies the lLifecycle Status ."; + } + + /* + * Grouping Definitions + */ + + grouping etht-bandwidth-profiles { + description + "Bandwidth profile configuration paramters."; + + leaf bandwidth-profile-type { + type etht-types:bandwidth-profile-type; + description + "The type of bandwidth profile."; + } + leaf CIR { + type uint64; + description + "Committed Information Rate in Kbps"; + } + leaf CBS { + type uint64; + description + "Committed Burst Size in in KBytes"; + } + leaf EIR { + type uint64; + /* Need to indicate that EIR is not supported by RFC 2697 + + must + '../bw-profile-type = "mef-10-bwp" or ' + + '../bw-profile-type = "rfc-2698-bwp" or ' + + '../bw-profile-type = "rfc-4115-bwp"' + + must + '../bw-profile-type != "rfc-2697-bwp"' + */ + description + "Excess Information Rate in Kbps + In case of RFC 2698, PIR = CIR + EIR"; + } + leaf EBS { + type uint64; + description + "Excess Burst Size in KBytes. + In case of RFC 2698, PBS = CBS + EBS"; + } + leaf color-aware { + type boolean; + description + "Indicates weather the color-mode is + color-aware or color-blind."; + } + leaf coupling-flag { + type boolean; + /* Need to indicate that Coupling Flag is defined only for MEF 10 + + must + '../bw-profile-type = "mef-10-bwp"' + */ + description + "Coupling Flag."; + } + } + + identity topology-role { + description + "The role of underlay topology: e.g., hub, spoke, + any-to-any."; + } + + identity resilience { + description + "Placeholder for resilience information in data plane, + for future study. "; + } + + identity access-role { + description + "Indicating whether the access is a working or protection access."; + } + + identity root-primary { + base access-role; + description + "Designates the primary root UNI of an E-Tree service, and may also + designates the UNI access role of E-LINE and E-LAN service."; + } + + identity root-backup { + base access-role; + description + "Designates the backup root UNI of an E-Tree service."; + } + + identity leaf-access { + base access-role; + description + "Designates the leaf UNI of an E-Tree service."; + } + + identity leaf-edge { + base access-role; + description ""; + } + + identity performance { + description + "Placeholder for performance information, for future study."; + } + + identity encapsulation-type { + description + "Indicating how the service is encapsulated (to PW), e.g, raw or tag. "; + } + grouping pw-segement-bandwidth-profile-grouping { + description + "bandwidth profile grouping for PW segment. "; + leaf bandwidth-profile-type { + type etht-types:bandwidth-profile-type; + description + "The type of bandwidth profile."; + } + leaf CIR { + type uint64; + description + "Committed Information Rate in Kbps"; + } + leaf CBS { + type uint64; + description + "Committed Burst Size in in KBytes"; + } + leaf EIR { + type uint64; + /* Need to indicate that EIR is not supported by RFC 2697 + + must + '../bw-profile-type = "mef-10-bwp" or ' + + '../bw-profile-type = "rfc-2698-bwp" or ' + + '../bw-profile-type = "rfc-4115-bwp"' + + must + '../bw-profile-type != "rfc-2697-bwp"' + */ + description + "Excess Information Rate in Kbps + In case of RFC 2698, PIR = CIR + EIR"; + } + leaf EBS { + type uint64; + description + "Excess Burst Size in KBytes. + In case of RFC 2698, PBS = CBS + EBS"; + } + } + grouping eth-bandwidth { + description + "Available bandwith for ethernet."; + leaf eth-bandwidth { + type uint64{ + range "0..10000000000"; + } + units "Kbps"; + description + "Available bandwith value expressed in kilobits per second"; + } + } + + grouping eth-label-restriction { + description + "Label Restriction for ethernet."; + leaf tag-type { + type etht-types:eth-tag-type; + description "VLAN tag type."; + } + leaf priority { + type uint8; + description "priority."; + } + } + grouping eth-label { + description + "Label for ethernet."; + leaf vlanid { + type etht-types:vlanid; + description + "VLAN tag id."; + } + } + + grouping eth-label-step { + description "Label step for Ethernet VLAN"; + leaf eth-step { + type uint16 { + range "1..4095"; + } + default 1; + description + "Label step which represent possible increments for + an Ethernet VLAN tag."; + reference + "IEEE 802.1ad: Provider Bridges."; + } + } + } diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-trans-client-service@2023-10-23.yang b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-trans-client-service@2023-10-23.yang new file mode 100644 index 000000000..f0157bcc8 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-trans-client-service@2023-10-23.yang @@ -0,0 +1,325 @@ + module ietf-trans-client-service { + /* TODO: FIXME */ + yang-version 1.1; + + namespace "urn:ietf:params:xml:ns:yang:ietf-trans-client-service"; + prefix "clntsvc"; + + import ietf-network { + prefix "nw"; + reference "RFC8345 - A YANG Data Model for Network Topologies"; + } + + import ietf-network-topology { + prefix "nt"; + reference "RFC8345 - A YANG Data Model for Network Topologies"; + } + + import ietf-te-types { + prefix "te-types"; + reference "RFC 8776 - Traffic Engineering Common YANG Types"; + } + + import ietf-layer1-types { + prefix "layer1-types"; + reference "RFC ZZZZ - A YANG Data Model for Layer 1 Types"; + } + + import ietf-yang-types { + prefix "yang"; + reference "RFC 6991 - Common YANG Data Types"; + } + + import ietf-trans-client-svc-types { + prefix "clntsvc-types"; + reference "RFC XXXX - A YANG Data Model for + Transport Network Client Signals"; + } + + organization + "Internet Engineering Task Force (IETF) CCAMP WG"; + contact + " + ID-draft editor: + Haomian Zheng (zhenghaomian@huawei.com); + Aihua Guo (aihuaguo.ietf@gmail.com); + Italo Busi (italo.busi@huawei.com); + Anton Snitser (antons@sedonasys.com); + Francesco Lazzeri (francesco.lazzeri@ericsson.com); + Yunbin Xu (xuyunbin@caict.ac.cn); + Yang Zhao (zhaoyangyjy@chinamobile.com); + Xufeng Liu (Xufeng_Liu@jabil.com); + Giuseppe Fioccola (giuseppe.fioccola@huawei.com); + Chaode Yu (yuchaode@huawei.com); + "; + + description + "This module defines a YANG data model for describing + transport network client services. The model fully conforms + to the Network Management Datastore Architecture (NMDA). + + Copyright (c) 2021 IETF Trust and the persons + identified as authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (https://trustee.ietf.org/license-info). + This version of this YANG module is part of RFC XXXX; see + the RFC itself for full legal notices."; + revision 2023-10-23 { + description + "version -04 as a WG document"; + reference + "draft-ietf-ccamp-client-signal-yang"; + } + + /* + * Groupings + */ + grouping client-svc-access-parameters { + description + "Transport network client signals access parameters"; + + leaf access-node-id { + type te-types:te-node-id; + description + "The identifier of the access node in the TE topology."; + } + + leaf access-node-uri { + type nw:node-id; + description + "The identifier of the access node in the network."; + } + + leaf access-ltp-id { + type te-types:te-tp-id; + description + "The TE link termination point identifier in TE topology, used + together with access-node-id to identify the access LTP."; + } + + leaf access-ltp-uri { + type nt:tp-id; + description + "The link termination point identifier in network topology, + used together with access-node-uri to identify the access LTP"; + } + + leaf client-signal { + type identityref { + base layer1-types:client-signal; + } + description + "Identify the client signal type associated with this port"; + } + + } + + grouping pm-state-grouping { + leaf latency { + description "latency value of the E2E client signal service"; + type uint32; + units microsecond; + } + } + + grouping error-info-grouping { + leaf error-code { + description "error code"; + type uint16; + } + + leaf error-description { + description "detail message of error"; + type string; + } + + leaf error-timestamp { + description "the date and time error is happened"; + type yang:date-and-time; + } + } + + grouping alarm-shreshold-grouping { + leaf latency-threshold { + description "a threshold for the E2E client signal service's + latency. Once the latency value exceed this threshold, an alarm + should be triggered."; + type uint32; + units microsecond; + } + } + + grouping client-svc-tunnel-parameters { + description + "Transport network client signals tunnel parameters"; + + leaf tunnel-name { + type string; + description + "TE tunnel instance name."; + } + } + + grouping client-svc-instance-config { + description + "Configuration parameters for client services."; + leaf client-svc-name { + type string; + description + "Identifier of the p2p transport network client signals."; + } + + leaf client-svc-title { + type string; + description + "Name of the p2p transport network client signals."; + } + + leaf user-label { + type string; + description + "Alias of the p2p transport network client signals."; + } + + leaf client-svc-descr { + type string; + description + "Description of the transport network client signals."; + } + + leaf client-svc-customer { + type string; + description + "Customer of the transport network client signals."; + } + + container resilience { + description "Place holder for resilience functionalities"; + } + + uses te-types:te-topology-identifier; + + leaf admin-status { + type identityref { + base te-types:tunnel-admin-state-type; + } + default te-types:tunnel-admin-state-up; + description "Client signals administrative state."; + } + + container src-access-ports { + description + "Source access port of a client signal."; + uses client-svc-access-parameters; + } + container dst-access-ports { + description + "Destination access port of a client signal."; + uses client-svc-access-parameters; + } + + container pm-state { + config false; + description "PM data of E2E client signal"; + uses pm-state-grouping; + } + + container error-info { + config false; + description "error messages of configuration"; + uses error-info-grouping; + } + + container alarm-shreshold { + description "threshold configuration for the E2E client signal"; + uses alarm-shreshold-grouping; + } + + leaf direction { + type identityref { + base clntsvc-types:direction; + } + description "Uni-dir or Bi-dir for the client signal."; + } + + list svc-tunnels { + key tunnel-name; + description + "List of the TE Tunnels supporting the client signal."; + uses client-svc-tunnel-parameters; + } + } + + grouping client-svc-instance-state { + description + "State parameters for client services."; + leaf operational-state { + type identityref { + base te-types:tunnel-state-type; + } + config false; + description "Client signal operational state."; + } + leaf provisioning-state { + type identityref { + base te-types:lsp-state-type; + } + config false; + description "Client signal provisioning state."; + } + leaf creation-time { + type yang:date-and-time; + config false; + description "The time of the client signal be created."; + } + leaf last-updated-time { + type yang:date-and-time; + config false; + description "The time of the client signal's latest update."; + } + leaf created-by { + type string; + config false; + description + "The client signal is created by whom, + can be a system or staff ID."; + } + leaf last-updated-by { + type string; + config false; + description + "The client signal is last updated by whom, + can be a system or staff ID."; + } + leaf owned-by { + type string; + config false; + description + "The client signal is owned by whom, + can be a system ID."; + } + } + + /* + * Data nodes + */ + + container client-svc { + description + "Transport client services."; + + list client-svc-instances { + key client-svc-name; + description + "The list of p2p transport client service instances"; + + uses client-svc-instance-config; + uses client-svc-instance-state; + } + } + } diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-trans-client-svc-types@2023-10-23.yang b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-trans-client-svc-types@2023-10-23.yang new file mode 100644 index 000000000..60db5633a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-trans-client-svc-types@2023-10-23.yang @@ -0,0 +1,63 @@ + module ietf-trans-client-svc-types { + namespace "urn:ietf:params:xml:ns:yang:ietf-trans-client-svc-types"; + prefix "clntsvc-types"; + + organization + "Internet Engineering Task Force (IETF) CCAMP WG"; + contact + " + ID-draft editor: + Haomian Zheng (zhenghaomian@huawei.com); + Aihua Guo (aihuaguo.ietf@gmail.com); + Italo Busi (italo.busi@huawei.com); + Anton Snitser (antons@sedonasys.com); + Francesco Lazzeri (francesco.lazzeri@ericsson.com); + Yunbin Xu (xuyunbin@caict.ac.cn); + Yang Zhao (zhaoyangyjy@chinamobile.com); + Xufeng Liu (Xufeng_Liu@jabil.com); + Giuseppe Fioccola (giuseppe.fioccola@huawei.com); + Chaode Yu (yuchaode@huawei.com); + "; + + description + "This module defines a YANG data model for describing + transport network client types. The model fully conforms + to the Network Management Datastore Architecture (NMDA). + + Copyright (c) 2019 IETF Trust and the persons + identified as authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (https://trustee.ietf.org/license-info). + This version of this YANG module is part of RFC XXXX; see + the RFC itself for full legal notices."; + + revision 2023-10-23 { + description + "version -01 as a WG document"; + reference + "draft-ietf-ccamp-client-signal-yang"; + } + + identity direction { + description + "Direction information of Client Signal."; + } + + identity bidirectional { + base direction; + description + "Client Signal is bi-directional."; + } + + identity unidirectional { + base direction; + description + "Client Signal is uni-directional."; + } + + } diff --git a/src/nbi/tests/test_ietf_network.py b/src/nbi/tests/test_ietf_network.py index 8948cc173..9dad96ebb 100644 --- a/src/nbi/tests/test_ietf_network.py +++ b/src/nbi/tests/test_ietf_network.py @@ -62,11 +62,12 @@ def sort_data(data : Dict) -> None: key=operator.itemgetter('node-id') ) - if 'ietf-network-topology:termination-point' in network['node']: - network['node']['ietf-network-topology:termination-point'] = sorted( - network['node']['ietf-network-topology:termination-point'], - key=operator.itemgetter('tp-id') - ) + for node in network['node']: + if 'ietf-network-topology:termination-point' in node: + node['ietf-network-topology:termination-point'] = sorted( + node['ietf-network-topology:termination-point'], + key=operator.itemgetter('tp-id') + ) if 'ietf-network-topology:link' in network: network['ietf-network-topology:link'] = sorted( -- GitLab From 0d45dc6cbe2c24566ff46a2412e09cf8da18debc Mon Sep 17 00:00:00 2001 From: gifrerenom Date: Fri, 15 Dec 2023 15:28:06 +0000 Subject: [PATCH 07/16] NBI Component - IETF Network plugin: - Added loggers in ietf_network unitary tests - Added loggers in node composer - Added custom name/id mappers for termination points - Corrected manual fixes - Added test_ietf_network to CI/CD pipeline --- src/nbi/.gitlab-ci.yml | 2 +- .../nbi_plugins/ietf_network/ComposeNode.py | 7 +++- .../ietf_network/ComposeTermPoint.py | 38 ++++++++++++------- .../nbi_plugins/ietf_network/ManualFixes.py | 3 +- src/nbi/tests/test_ietf_network.py | 6 ++- 5 files changed, 38 insertions(+), 18 deletions(-) diff --git a/src/nbi/.gitlab-ci.yml b/src/nbi/.gitlab-ci.yml index 0b12f9f08..7d98e6160 100644 --- a/src/nbi/.gitlab-ci.yml +++ b/src/nbi/.gitlab-ci.yml @@ -56,7 +56,7 @@ unit_test nbi: - sleep 5 - docker ps -a - docker logs $IMAGE_NAME - - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml" + - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary.py $IMAGE_NAME/tests/test_ietf_network.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml" - docker exec -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing" coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' after_script: diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeNode.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeNode.py index e40039961..3f000f2d8 100644 --- a/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeNode.py +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeNode.py @@ -12,12 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. +import logging from common.proto.context_pb2 import Device from .bindings.networks.network.node import node from .ComposeTermPoint import compose_term_point from .NameMapping import NameMappings from .NetworkTypeEnum import NetworkTypeEnum +LOGGER = logging.getLogger(__name__) + NODE_NAME_MAPPINGS = { '10.0.10.1': 'OA', '10.0.20.1': 'P', @@ -28,9 +31,11 @@ NODE_NAME_MAPPINGS = { def compose_node( ietf_node_obj : node, device : Device, name_mappings : NameMappings, network_type : NetworkTypeEnum ) -> None: + device_name = device.name + LOGGER.warning('network_type={:s} device_name={:s}'.format(str(network_type.value), str(device_name))) + name_mappings.store_device_name(device) - device_name = device.name ietf_node_obj.te_node_id = device_name ietf_node_obj.te._set_oper_status('up') diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeTermPoint.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeTermPoint.py index 9ac03c3e7..1533a9c0d 100644 --- a/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeTermPoint.py +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeTermPoint.py @@ -17,20 +17,32 @@ from .bindings.networks.network.node.termination_point import termination_point from .NameMapping import NameMappings from .NetworkTypeEnum import NetworkTypeEnum -TP_NAME_MAPPINGS = { - (NetworkTypeEnum.TE_OTN_TOPOLOGY, '10.0.10.1', '200'): '1-1-1-1-1', - (NetworkTypeEnum.TE_OTN_TOPOLOGY, '10.0.10.1', '500'): '1-1-1-1-1', - (NetworkTypeEnum.TE_OTN_TOPOLOGY, '10.0.10.1', '501'): '1-1-1-1-1', +MAPPINGS_TE_NAME = { + (NetworkTypeEnum.TE_OTN_TOPOLOGY, '10.0.10.1', '200'): '1-1-1-1-1', + (NetworkTypeEnum.TE_OTN_TOPOLOGY, '10.0.10.1', '500'): '1-1-1-1-1', + (NetworkTypeEnum.TE_OTN_TOPOLOGY, '10.0.10.1', '501'): '1-1-1-1-1', - (NetworkTypeEnum.TE_OTN_TOPOLOGY, '10.0.20.1', '500'): '1-1-1-1-1', - (NetworkTypeEnum.TE_OTN_TOPOLOGY, '10.0.20.1', '501'): '1-1-1-1-1', + (NetworkTypeEnum.TE_OTN_TOPOLOGY, '10.0.20.1', '500'): '1-1-1-1-1', + (NetworkTypeEnum.TE_OTN_TOPOLOGY, '10.0.20.1', '501'): '1-1-1-1-1', - (NetworkTypeEnum.TE_OTN_TOPOLOGY, '10.0.30.1', '200'): '1-1-1-1-1', - (NetworkTypeEnum.TE_OTN_TOPOLOGY, '10.0.30.1', '500'): '1-1-1-1-1', - (NetworkTypeEnum.TE_OTN_TOPOLOGY, '10.0.30.1', '501'): '1-1-1-1-1', + (NetworkTypeEnum.TE_OTN_TOPOLOGY, '10.0.30.1', '200'): '1-1-1-1-1', + (NetworkTypeEnum.TE_OTN_TOPOLOGY, '10.0.30.1', '500'): '1-1-1-1-1', + (NetworkTypeEnum.TE_OTN_TOPOLOGY, '10.0.30.1', '501'): '1-1-1-1-1', - (NetworkTypeEnum.TE_OTN_TOPOLOGY, '10.0.40.1', '500'): '1-1-1-1-1', - (NetworkTypeEnum.TE_OTN_TOPOLOGY, '10.0.40.1', '501'): '1-1-1-1-1', + (NetworkTypeEnum.TE_OTN_TOPOLOGY, '10.0.40.1', '500'): '1-1-1-1-1', + (NetworkTypeEnum.TE_OTN_TOPOLOGY, '10.0.40.1', '501'): '1-1-1-1-1', + + (NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY, '10.0.10.1', '200'): 'endpoint:111', + (NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY, '10.0.10.1', '500'): 'endpoint:111', + (NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY, '10.0.10.1', '501'): 'endpoint:111', + + (NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY, '10.0.30.1', '200'): '172.10.33.254', + (NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY, '10.0.30.1', '500'): 'endpoint:111', + (NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY, '10.0.30.1', '501'): 'endpoint:111', +} + +MAPPINGS_TE_TP_ID = { + (NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY, '10.0.10.1', '200'): '128.32.33.254', } def compose_term_point( @@ -42,11 +54,11 @@ def compose_term_point( device_name = device.name endpoint_name = endpoint.name - ietf_tp_obj.te_tp_id = endpoint_name + ietf_tp_obj.te_tp_id = MAPPINGS_TE_TP_ID.get((network_type, device_name, endpoint_name), endpoint_name) ietf_tp_obj.te._set_oper_status('up') ietf_tp_obj.te.admin_status = 'up' - ietf_tp_obj.te.name = TP_NAME_MAPPINGS.get((network_type, device_name, endpoint_name), endpoint_name) + ietf_tp_obj.te.name = MAPPINGS_TE_NAME.get((network_type, device_name, endpoint_name), endpoint_name) if network_type == NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY: ietf_if_sw_cap = ietf_tp_obj.te.interface_switching_capability.add( diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/ManualFixes.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/ManualFixes.py index a5f27adaf..778fea586 100644 --- a/src/nbi/service/rest_server/nbi_plugins/ietf_network/ManualFixes.py +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/ManualFixes.py @@ -39,7 +39,8 @@ def manual_fixes(json_response : Dict) -> None: if json_node['node-id'] in {'10.0.10.1', '10.0.30.1'}: if network_type == NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY: if 'ietf-eth-te-topology:eth-svc' in json_tp: - json_tp['ietf-eth-te-topology:eth-svc']['client-facing'] = True + client_facing = json_tp['tp-id'] == '200' + json_tp['ietf-eth-te-topology:eth-svc']['client-facing'] = client_facing json_tp_te = json_tp.get('ietf-te-topology:te', {}) diff --git a/src/nbi/tests/test_ietf_network.py b/src/nbi/tests/test_ietf_network.py index 9dad96ebb..a8b812437 100644 --- a/src/nbi/tests/test_ietf_network.py +++ b/src/nbi/tests/test_ietf_network.py @@ -28,7 +28,7 @@ from .PrepareTestScenario import ( # pylint: disable=unused-import LOGGER = logging.getLogger(__name__) LOGGER.setLevel(logging.DEBUG) -DESCRIPTOR_FILE = 'nbi/tests/data/topology_dummy.json' +DESCRIPTOR_FILE = 'nbi/tests/data/topology-dummy.json' TARGET_DATA_FILE = 'nbi/tests/data/test-ietf-network.json' JSON_ADMIN_CONTEXT_ID = json_context_id(DEFAULT_CONTEXT_NAME) @@ -81,7 +81,9 @@ def test_rest_get_networks(nbi_service_rest : RestServer): # pylint: disable=red URL = '/restconf/data/ietf-network:networks' retrieved_data = do_rest_request(URL, logger=LOGGER, expected_status_codes={200}) sort_data(retrieved_data) - sort_data(target_data ) + LOGGER.warning('retrieved_data={:s}'.format(json.dumps(retrieved_data, sort_keys=True))) + sort_data(target_data) + LOGGER.warning('target_data={:s}'.format(json.dumps(target_data, sort_keys=True))) diff_data = deepdiff.DeepDiff(target_data, retrieved_data) LOGGER.error('Differences:\n{:s}'.format(str(diff_data.pretty()))) assert len(diff_data) == 0 -- GitLab From a25700f4a152add5949a7dd7b7d5a4bc16d15d99 Mon Sep 17 00:00:00 2001 From: gifrerenom Date: Fri, 15 Dec 2023 15:31:22 +0000 Subject: [PATCH 08/16] NBI Component - IETF Network plugin: - Fixed unitary test data files --- .../tests/data/test-ietf-network-huawei.json | 1944 +++++++++++++++++ src/nbi/tests/data/test-ietf-network.json | 226 +- ...opology_dummy.json => topology-dummy.json} | 33 +- src/nbi/tests/data/topology-real.json | 33 +- 4 files changed, 2133 insertions(+), 103 deletions(-) create mode 100644 src/nbi/tests/data/test-ietf-network-huawei.json rename src/nbi/tests/data/{topology_dummy.json => topology-dummy.json} (95%) diff --git a/src/nbi/tests/data/test-ietf-network-huawei.json b/src/nbi/tests/data/test-ietf-network-huawei.json new file mode 100644 index 000000000..37bf8e57b --- /dev/null +++ b/src/nbi/tests/data/test-ietf-network-huawei.json @@ -0,0 +1,1944 @@ +{ + "ietf-network:networks": { + "network": [ + { + "network-id": "providerId-10-clientId-0-topologyId-1", + "ietf-te-topology:te": { + "name": "Huawei-Network" + }, + "ietf-te-topology:te-topology-identifier": { + "provider-id": 10, + "client-id": 0, + "topology-id": "1" + }, + "network-types": { + "ietf-te-topology:te-topology": { + "ietf-otn-topology:otn-topology": {} + } + }, + "node": [ + { + "node-id": "10.0.10.1", + "ietf-te-topology:te-node-id": "10.0.10.1", + "ietf-network-topology:termination-point": [ + { + "tp-id": "501", + "ietf-te-topology:te-tp-id": 501, + "ietf-te-topology:te": { + "name": "1-1-1-1-1", + "admin-status": "up", + "oper-status": "up", + "ietf-otn-topology:client-svc": { + "client-facing": false + }, + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-oduk", + "switching-capability": "ietf-te-types:switching-otn", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:otn": { + "odu-type": "ietf-layer1-types:ODU4" + } + } + } + ] + } + ] + } + }, + { + "tp-id": "500", + "ietf-te-topology:te-tp-id": 500, + "ietf-te-topology:te": { + "name": "1-1-1-1-1", + "admin-status": "up", + "oper-status": "up", + "ietf-otn-topology:client-svc": { + "client-facing": false + }, + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-oduk", + "switching-capability": "ietf-te-types:switching-otn", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:otn": { + "odu-type": "ietf-layer1-types:ODU4" + } + } + } + ] + } + ] + } + } + ], + "ietf-te-topology:te": { + "oper-status": "up", + "te-node-attributes": { + "admin-status": "up", + "name": "OA" + }, + "tunnel-termination-point": [ + { + "tunnel-tp-id": "NTAx", + "admin-status": "up", + "oper-status": "up", + "encoding": "ietf-te-types:lsp-encoding-oduk", + "name": "1-1-1-1-1", + "protection-type": "ietf-te-types:lsp-protection-unprotected", + "switching-capability": "ietf-te-types:switching-otn", + "local-link-connectivities": { + "local-link-connectivity": [ + { + "is-allowed": true, + "link-tp-ref": "501" + } + ] + } + }, + { + "tunnel-tp-id": "NTAw", + "admin-status": "up", + "oper-status": "up", + "encoding": "ietf-te-types:lsp-encoding-oduk", + "name": "1-1-1-1-1", + "protection-type": "ietf-te-types:lsp-protection-unprotected", + "switching-capability": "ietf-te-types:switching-otn", + "local-link-connectivities": { + "local-link-connectivity": [ + { + "is-allowed": true, + "link-tp-ref": "500" + } + ] + } + } + ] + } + }, + { + "node-id": "10.0.20.1", + "ietf-te-topology:te-node-id": "10.0.20.1", + "ietf-network-topology:termination-point": [ + { + "tp-id": "501", + "ietf-te-topology:te-tp-id": 501, + "ietf-te-topology:te": { + "name": "1-1-1-1-1", + "admin-status": "up", + "oper-status": "up", + "ietf-otn-topology:client-svc": { + "client-facing": false + }, + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-oduk", + "switching-capability": "ietf-te-types:switching-otn", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:otn": { + "odu-type": "ietf-layer1-types:ODU4" + } + } + } + ] + } + ] + } + }, + { + "tp-id": "500", + "ietf-te-topology:te-tp-id": 500, + "ietf-te-topology:te": { + "name": "1-1-1-1-1", + "admin-status": "up", + "oper-status": "up", + "ietf-otn-topology:client-svc": { + "client-facing": false + }, + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-oduk", + "switching-capability": "ietf-te-types:switching-otn", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:otn": { + "odu-type": "ietf-layer1-types:ODU4" + } + } + } + ] + } + ] + } + } + ], + "ietf-te-topology:te": { + "oper-status": "up", + "te-node-attributes": { + "admin-status": "up", + "name": "P" + }, + "tunnel-termination-point": [ + { + "tunnel-tp-id": "NTAx", + "admin-status": "up", + "oper-status": "up", + "encoding": "ietf-te-types:lsp-encoding-oduk", + "name": "1-1-1-1-1", + "protection-type": "ietf-te-types:lsp-protection-unprotected", + "switching-capability": "ietf-te-types:switching-otn", + "local-link-connectivities": { + "local-link-connectivity": [ + { + "is-allowed": true, + "link-tp-ref": "501" + } + ] + } + }, + { + "tunnel-tp-id": "NTAw", + "admin-status": "up", + "oper-status": "up", + "encoding": "ietf-te-types:lsp-encoding-oduk", + "name": "1-1-1-1-1", + "protection-type": "ietf-te-types:lsp-protection-unprotected", + "switching-capability": "ietf-te-types:switching-otn", + "local-link-connectivities": { + "local-link-connectivity": [ + { + "is-allowed": true, + "link-tp-ref": "500" + } + ] + } + } + ] + } + }, + { + "node-id": "10.0.40.1", + "ietf-te-topology:te-node-id": "10.0.40.1", + "ietf-network-topology:termination-point": [ + { + "tp-id": "500", + "ietf-te-topology:te-tp-id": 500, + "ietf-te-topology:te": { + "name": "1-1-1-1-1", + "admin-status": "up", + "oper-status": "up", + "ietf-otn-topology:client-svc": { + "client-facing": false + }, + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-oduk", + "switching-capability": "ietf-te-types:switching-otn", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:otn": { + "odu-type": "ietf-layer1-types:ODU4" + } + } + } + ] + } + ] + } + }, + { + "tp-id": "501", + "ietf-te-topology:te-tp-id": 501, + "ietf-te-topology:te": { + "name": "1-1-1-1-1", + "admin-status": "up", + "oper-status": "up", + "ietf-otn-topology:client-svc": { + "client-facing": false + }, + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-oduk", + "switching-capability": "ietf-te-types:switching-otn", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:otn": { + "odu-type": "ietf-layer1-types:ODU4" + } + } + } + ] + } + ] + } + } + ], + "ietf-te-topology:te": { + "oper-status": "up", + "te-node-attributes": { + "admin-status": "up", + "name": "P" + }, + "tunnel-termination-point": [ + { + "tunnel-tp-id": "NTAw", + "admin-status": "up", + "oper-status": "up", + "encoding": "ietf-te-types:lsp-encoding-oduk", + "name": "1-1-1-1-1", + "protection-type": "ietf-te-types:lsp-protection-unprotected", + "switching-capability": "ietf-te-types:switching-otn", + "local-link-connectivities": { + "local-link-connectivity": [ + { + "is-allowed": true, + "link-tp-ref": "500" + } + ] + } + }, + { + "tunnel-tp-id": "NTAx", + "admin-status": "up", + "oper-status": "up", + "encoding": "ietf-te-types:lsp-encoding-oduk", + "name": "1-1-1-1-1", + "protection-type": "ietf-te-types:lsp-protection-unprotected", + "switching-capability": "ietf-te-types:switching-otn", + "local-link-connectivities": { + "local-link-connectivity": [ + { + "is-allowed": true, + "link-tp-ref": "501" + } + ] + } + } + ] + } + }, + { + "node-id": "10.0.30.1", + "ietf-te-topology:te-node-id": "10.0.30.1", + "ietf-network-topology:termination-point": [ + { + "tp-id": "500", + "ietf-te-topology:te-tp-id": 500, + "ietf-te-topology:te": { + "name": "1-1-1-1-1", + "admin-status": "up", + "oper-status": "up", + "ietf-otn-topology:client-svc": { + "client-facing": false + }, + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-oduk", + "switching-capability": "ietf-te-types:switching-otn", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:otn": { + "odu-type": "ietf-layer1-types:ODU4" + } + } + } + ] + } + ] + } + }, + { + "tp-id": "501", + "ietf-te-topology:te-tp-id": 501, + "ietf-te-topology:te": { + "name": "1-1-1-1-1", + "admin-status": "up", + "oper-status": "up", + "ietf-otn-topology:client-svc": { + "client-facing": false + }, + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-oduk", + "switching-capability": "ietf-te-types:switching-otn", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:otn": { + "odu-type": "ietf-layer1-types:ODU4" + } + } + } + ] + } + ] + } + } + ], + "ietf-te-topology:te": { + "oper-status": "up", + "te-node-attributes": { + "admin-status": "up", + "name": "OE" + }, + "tunnel-termination-point": [ + { + "tunnel-tp-id": "NTAw", + "admin-status": "up", + "oper-status": "up", + "encoding": "ietf-te-types:lsp-encoding-oduk", + "name": "1-1-1-1-1", + "protection-type": "ietf-te-types:lsp-protection-unprotected", + "switching-capability": "ietf-te-types:switching-otn", + "local-link-connectivities": { + "local-link-connectivity": [ + { + "is-allowed": true, + "link-tp-ref": "500" + } + ] + } + }, + { + "tunnel-tp-id": "NTAx", + "admin-status": "up", + "oper-status": "up", + "encoding": "ietf-te-types:lsp-encoding-oduk", + "name": "1-1-1-1-1", + "protection-type": "ietf-te-types:lsp-protection-unprotected", + "switching-capability": "ietf-te-types:switching-otn", + "local-link-connectivities": { + "local-link-connectivity": [ + { + "is-allowed": true, + "link-tp-ref": "501" + } + ] + } + } + ] + } + } + ], + "ietf-network-topology:link": [ + { + "link-id": "10.0.10.1-501", + "source": { + "source-node": "10.0.10.1", + "source-tp": "501" + }, + "destination": { + "dest-node": "10.0.20.1", + "dest-tp": "501" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.10.1-501", + "te-delay-metric": 1, + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-otn-topology:odulist": [ + { + "odu-type": "ietf-layer1-types:ODU0", + "number": 80 + } + ] + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:odulist": [ + { + "number": 80, + "odu-type": "ietf-layer1-types:ODU0" + } + ] + } + } + ] + } + } + }, + { + "link-id": "10.0.10.1-500", + "source": { + "source-node": "10.0.10.1", + "source-tp": "500" + }, + "destination": { + "dest-node": "10.0.40.1", + "dest-tp": "500" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.10.1-500", + "te-delay-metric": 1, + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-otn-topology:odulist": [ + { + "odu-type": "ietf-layer1-types:ODU0", + "number": 80 + } + ] + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:odulist": [ + { + "number": 80, + "odu-type": "ietf-layer1-types:ODU0" + } + ] + } + } + ] + } + } + }, + { + "link-id": "10.0.20.1-501", + "source": { + "source-node": "10.0.20.1", + "source-tp": "501" + }, + "destination": { + "dest-node": "10.0.10.1", + "dest-tp": "501" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.20.1-501", + "te-delay-metric": 1, + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-otn-topology:odulist": [ + { + "odu-type": "ietf-layer1-types:ODU0", + "number": 80 + } + ] + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:odulist": [ + { + "number": 80, + "odu-type": "ietf-layer1-types:ODU0" + } + ] + } + } + ] + } + } + }, + { + "link-id": "10.0.20.1-500", + "source": { + "source-node": "10.0.20.1", + "source-tp": "500" + }, + "destination": { + "dest-node": "10.0.30.1", + "dest-tp": "500" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.20.1-500", + "te-delay-metric": 1, + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-otn-topology:odulist": [ + { + "odu-type": "ietf-layer1-types:ODU0", + "number": 80 + } + ] + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:odulist": [ + { + "number": 80, + "odu-type": "ietf-layer1-types:ODU0" + } + ] + } + } + ] + } + } + }, + { + "link-id": "10.0.40.1-500", + "source": { + "source-node": "10.0.40.1", + "source-tp": "500" + }, + "destination": { + "dest-node": "10.0.10.1", + "dest-tp": "500" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.40.1-500", + "te-delay-metric": 1, + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-otn-topology:odulist": [ + { + "odu-type": "ietf-layer1-types:ODU0", + "number": 80 + } + ] + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:odulist": [ + { + "number": 80, + "odu-type": "ietf-layer1-types:ODU0" + } + ] + } + } + ] + } + } + }, + { + "link-id": "10.0.40.1-501", + "source": { + "source-node": "10.0.40.1", + "source-tp": "501" + }, + "destination": { + "dest-node": "10.0.30.1", + "dest-tp": "501" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.40.1-501", + "te-delay-metric": 1, + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-otn-topology:odulist": [ + { + "odu-type": "ietf-layer1-types:ODU0", + "number": 80 + } + ] + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:odulist": [ + { + "number": 80, + "odu-type": "ietf-layer1-types:ODU0" + } + ] + } + } + ] + } + } + }, + { + "link-id": "10.0.30.1-500", + "source": { + "source-node": "10.0.30.1", + "source-tp": "500" + }, + "destination": { + "dest-node": "10.0.20.1", + "dest-tp": "500" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.30.1-500", + "te-delay-metric": 1, + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-otn-topology:odulist": [ + { + "odu-type": "ietf-layer1-types:ODU0", + "number": 80 + } + ] + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:odulist": [ + { + "number": 80, + "odu-type": "ietf-layer1-types:ODU0" + } + ] + } + } + ] + } + } + }, + { + "link-id": "10.0.30.1-501", + "source": { + "source-node": "10.0.30.1", + "source-tp": "501" + }, + "destination": { + "dest-node": "10.0.40.1", + "dest-tp": "501" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.30.1-501", + "te-delay-metric": 1, + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-otn-topology:odulist": [ + { + "odu-type": "ietf-layer1-types:ODU0", + "number": 80 + } + ] + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-otn-topology:odulist": [ + { + "number": 80, + "odu-type": "ietf-layer1-types:ODU0" + } + ] + } + } + ] + } + } + } + ] + }, + { + "network-id": "providerId-10-clientId-0-topologyId-2", + "ietf-te-topology:te": { + "name": "Huawei-Network" + }, + "ietf-te-topology:te-topology-identifier": { + "provider-id": 10, + "client-id": 0, + "topology-id": "2" + }, + "network-types": { + "ietf-te-topology:te-topology": { + "ietf-eth-te-topology:eth-tran-topology": {} + } + }, + "node": [ + { + "node-id": "10.0.10.1", + "ietf-te-topology:te-node-id": "10.0.10.1", + "ietf-network-topology:termination-point": [ + { + "tp-id": "200", + "ietf-te-topology:te-tp-id": "128.32.33.254", + "ietf-eth-te-topology:eth-svc": { + "client-facing": true, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4094" + } + } + } + }, + "ietf-te-topology:te": { + "name": "endpoint:111", + "admin-status": "up", + "oper-status": "up", + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-ethernet", + "switching-capability": "ietf-te-types:switching-l2sc", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + ] + } + }, + { + "tp-id": "501", + "ietf-te-topology:te-tp-id": 501, + "ietf-eth-te-topology:eth-svc": { + "client-facing": false, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4094" + } + } + } + }, + "ietf-te-topology:te": { + "name": "endpoint:111", + "admin-status": "up", + "oper-status": "up", + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-ethernet", + "switching-capability": "ietf-te-types:switching-l2sc", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + ] + } + }, + { + "tp-id": "500", + "ietf-te-topology:te-tp-id": 500, + "ietf-eth-te-topology:eth-svc": { + "client-facing": false, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4094" + } + } + } + }, + "ietf-te-topology:te": { + "name": "endpoint:111", + "admin-status": "up", + "oper-status": "up", + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-ethernet", + "switching-capability": "ietf-te-types:switching-l2sc", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + ] + } + } + ], + "ietf-te-topology:te": { + "oper-status": "up", + "te-node-attributes": { + "admin-status": "up", + "name": "OA" + } + } + }, + { + "node-id": "10.0.20.1", + "ietf-te-topology:te-node-id": "10.0.20.1", + "ietf-network-topology:termination-point": [ + { + "tp-id": "501", + "ietf-te-topology:te-tp-id": 501, + "ietf-eth-te-topology:eth-svc": { + "client-facing": false, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4094" + } + } + } + }, + "ietf-te-topology:te": { + "name": "endpoint:111", + "admin-status": "up", + "oper-status": "up", + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-ethernet", + "switching-capability": "ietf-te-types:switching-l2sc", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + ] + } + }, + { + "tp-id": "500", + "ietf-te-topology:te-tp-id": 500, + "ietf-eth-te-topology:eth-svc": { + "client-facing": false, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4094" + } + } + } + }, + "ietf-te-topology:te": { + "name": "endpoint:111", + "admin-status": "up", + "oper-status": "up", + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-ethernet", + "switching-capability": "ietf-te-types:switching-l2sc", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + ] + } + } + ], + "ietf-te-topology:te": { + "oper-status": "up", + "te-node-attributes": { + "admin-status": "up", + "name": "P" + } + } + }, + { + "node-id": "10.0.40.1", + "ietf-te-topology:te-node-id": "10.0.40.1", + "ietf-network-topology:termination-point": [ + { + "tp-id": "501", + "ietf-te-topology:te-tp-id": 501, + "ietf-eth-te-topology:eth-svc": { + "client-facing": false, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4094" + } + } + } + }, + "ietf-te-topology:te": { + "name": "endpoint:111", + "admin-status": "up", + "oper-status": "up", + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-ethernet", + "switching-capability": "ietf-te-types:switching-l2sc", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + ] + } + }, + { + "tp-id": "500", + "ietf-te-topology:te-tp-id": 500, + "ietf-eth-te-topology:eth-svc": { + "client-facing": false, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4094" + } + } + } + }, + "ietf-te-topology:te": { + "name": "endpoint:111", + "admin-status": "up", + "oper-status": "up", + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-ethernet", + "switching-capability": "ietf-te-types:switching-l2sc", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + ] + } + } + ], + "ietf-te-topology:te": { + "oper-status": "up", + "te-node-attributes": { + "admin-status": "up", + "name": "P" + } + } + }, + { + "node-id": "10.0.30.1", + "ietf-te-topology:te-node-id": "10.0.30.1", + "ietf-network-topology:termination-point": [ + { + "tp-id": "200", + "ietf-te-topology:te-tp-id": "172.10.33.254", + "ietf-eth-te-topology:eth-svc": { + "client-facing": true, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4094" + } + } + } + }, + "ietf-te-topology:te": { + "name": "endpoint:111", + "admin-status": "up", + "oper-status": "up", + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-ethernet", + "switching-capability": "ietf-te-types:switching-l2sc", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + ] + } + }, + { + "tp-id": "501", + "ietf-te-topology:te-tp-id": 501, + "ietf-eth-te-topology:eth-svc": { + "client-facing": false, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4094" + } + } + } + }, + "ietf-te-topology:te": { + "name": "endpoint:111", + "admin-status": "up", + "oper-status": "up", + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-ethernet", + "switching-capability": "ietf-te-types:switching-l2sc", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + ] + } + }, + { + "tp-id": "500", + "ietf-te-topology:te-tp-id": 500, + "ietf-eth-te-topology:eth-svc": { + "client-facing": false, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4094" + } + } + } + }, + "ietf-te-topology:te": { + "name": "endpoint:111", + "admin-status": "up", + "oper-status": "up", + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-ethernet", + "switching-capability": "ietf-te-types:switching-l2sc", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + ] + } + } + ], + "ietf-te-topology:te": { + "oper-status": "up", + "te-node-attributes": { + "admin-status": "up", + "name": "OE" + } + } + }, + { + "node-id": "128.32.33.5", + "ietf-te-topology:te-node-id": "128.32.33.5", + "ietf-network-topology:termination-point": [ + { + "tp-id": "500", + "ietf-te-topology:te-tp-id": "128.32.33.2", + "ietf-eth-te-topology:eth-svc": { + "client-facing": false, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4094" + } + } + } + }, + "ietf-te-topology:te": { + "name": "endpoint:111", + "admin-status": "up", + "oper-status": "up", + "interface-switching-capability": [ + { + "encoding": "ietf-te-types:lsp-encoding-ethernet", + "switching-capability": "ietf-te-types:switching-l2sc", + "max-lsp-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + ] + } + }, + { + "tp-id": "200", + "ietf-te-topology:te-tp-id": 200, + "ietf-eth-te-topology:eth-svc": { + "client-facing": true, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4096" + } + } + } + } + }, + { + "tp-id": "201", + "ietf-te-topology:te-tp-id": 201, + "ietf-eth-te-topology:eth-svc": { + "client-facing": true, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4096" + } + } + } + } + } + ], + "ietf-te-topology:te": { + "oper-status": "up", + "te-node-attributes": { + "admin-status": "up", + "name": "OLT", + "connectivity-matrices": { + "label-restrctions": { + "label-restrction": [ + { + "label-start": { + "te-label": { + "technology": { + "ietf-eth-te-topology:eth": { + "vlanid": 21 + } + } + } + }, + "label-end": { + "te-label": { + "technology": { + "ietf-eth-te-topology:eth": { + "vlanid": 21 + } + } + } + } + }, + { + "label-start": { + "te-label": { + "technology": { + "ietf-eth-te-topology:eth": { + "vlanid": 31 + } + } + } + }, + "label-end": { + "te-label": { + "technology": { + "ietf-eth-te-topology:eth": { + "vlanid": 31 + } + } + } + } + } + ] + } + } + } + } + }, + { + "node-id": "128.32.10.1", + "ietf-te-topology:te-node-id": "128.32.10.1", + "ietf-network-topology:termination-point": [ + { + "tp-id": "500", + "ietf-te-topology:te-tp-id": 500, + "ietf-eth-te-topology:eth-svc": { + "client-facing": false, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4094" + } + } + } + } + }, + { + "tp-id": "200", + "ietf-te-topology:te-tp-id": 200, + "ietf-eth-te-topology:eth-svc": { + "client-facing": true, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4096" + } + } + } + } + } + ], + "ietf-te-topology:te": { + "oper-status": "up", + "te-node-attributes": { + "admin-status": "up", + "name": "ONT1" + } + } + }, + { + "node-id": "128.32.20.1", + "ietf-te-topology:te-node-id": "128.32.20.1", + "ietf-network-topology:termination-point": [ + { + "tp-id": "500", + "ietf-te-topology:te-tp-id": 500, + "ietf-eth-te-topology:eth-svc": { + "client-facing": false, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4094" + } + } + } + } + }, + { + "tp-id": "200", + "ietf-te-topology:te-tp-id": 200, + "ietf-eth-te-topology:eth-svc": { + "client-facing": true, + "supported-classification": { + "port-classification": true, + "vlan-classification": { + "outer-tag": { + "supported-tag-types": [ + "ietf-eth-tran-types:classify-c-vlan", + "ietf-eth-tran-types:classify-s-vlan" + ], + "vlan-bundling": false, + "vlan-range": "1-4096" + } + } + } + } + } + ], + "ietf-te-topology:te": { + "oper-status": "up", + "te-node-attributes": { + "admin-status": "up", + "name": "ONT2" + } + } + } + ], + "ietf-network-topology:link": [ + { + "link-id": "10.0.10.1-200", + "source": { + "source-node": "10.0.10.1", + "source-tp": "200" + }, + "destination": { + "dest-node": "128.32.33.5", + "dest-tp": "500" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.10.1-200", + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + } + }, + { + "link-id": "128.32.33.5-500", + "source": { + "source-node": "128.32.33.5", + "source-tp": "500" + }, + "destination": { + "dest-node": "10.0.10.1", + "dest-tp": "200" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "128.32.33.5-500", + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + } + }, + { + "link-id": "10.0.10.1-501", + "source": { + "source-node": "10.0.10.1", + "source-tp": "501" + }, + "destination": { + "dest-node": "10.0.20.1", + "dest-tp": "501" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.10.1-501", + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + } + }, + { + "link-id": "10.0.10.1-500", + "source": { + "source-node": "10.0.10.1", + "source-tp": "500" + }, + "destination": { + "dest-node": "10.0.40.1", + "dest-tp": "500" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.10.1-500", + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + } + }, + { + "link-id": "10.0.20.1-501", + "source": { + "source-node": "10.0.20.1", + "source-tp": "501" + }, + "destination": { + "dest-node": "10.0.10.1", + "dest-tp": "501" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.20.1-501", + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + } + }, + { + "link-id": "10.0.20.1-500", + "source": { + "source-node": "10.0.20.1", + "source-tp": "500" + }, + "destination": { + "dest-node": "10.0.30.1", + "dest-tp": "500" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.20.1-500", + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + } + }, + { + "link-id": "10.0.40.1-501", + "source": { + "source-node": "10.0.40.1", + "source-tp": "501" + }, + "destination": { + "dest-node": "10.0.30.1", + "dest-tp": "501" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.40.1-501", + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + } + }, + { + "link-id": "10.0.40.1-500", + "source": { + "source-node": "10.0.40.1", + "source-tp": "500" + }, + "destination": { + "dest-node": "10.0.10.1", + "dest-tp": "500" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.40.1-500", + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + } + }, + { + "link-id": "10.0.30.1-501", + "source": { + "source-node": "10.0.30.1", + "source-tp": "501" + }, + "destination": { + "dest-node": "10.0.40.1", + "dest-tp": "501" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.30.1-501", + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + } + }, + { + "link-id": "10.0.30.1-500", + "source": { + "source-node": "10.0.0.1", + "source-tp": "500" + }, + "destination": { + "dest-node": "10.0.20.1", + "dest-tp": "500" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "10.0.30.1-500", + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + } + }, + { + "link-id": "128.32.33.5-200", + "source": { + "source-node": "128.32.33.5", + "source-tp": "200" + }, + "destination": { + "dest-node": "128.32.10.1", + "dest-tp": "500" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "128.32.33.5-200", + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + } + }, + { + "link-id": "128.32.10.1-500", + "source": { + "source-node": "128.32.10.1", + "source-tp": "500" + }, + "destination": { + "dest-node": "128.32.33.5", + "dest-tp": "200" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "128.32.10.1-500", + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + } + }, + { + "link-id": "128.32.33.5-201", + "source": { + "source-node": "128.32.33.5", + "source-tp": "201" + }, + "destination": { + "dest-node": "128.32.20.1", + "dest-tp": "500" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "128.32.33.5-201", + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + } + }, + { + "link-id": "128.32.20.1-500", + "source": { + "source-node": "128.32.20.1", + "source-tp": "500" + }, + "destination": { + "dest-node": "128.32.33.5", + "dest-tp": "201" + }, + "ietf-te-topology:te": { + "oper-status": "up", + "te-link-attributes": { + "access-type": "point-to-point", + "admin-status": "up", + "name": "128.32.20.15-500", + "max-link-bandwidth": { + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + }, + "unreserved-bandwidth": [ + { + "priority": 7, + "te-bandwidth": { + "ietf-eth-te-topology:eth-bandwidth": 10000000 + } + } + ] + } + } + } + ] + } + ] + } +} diff --git a/src/nbi/tests/data/test-ietf-network.json b/src/nbi/tests/data/test-ietf-network.json index 37bf8e57b..2a09d547b 100644 --- a/src/nbi/tests/data/test-ietf-network.json +++ b/src/nbi/tests/data/test-ietf-network.json @@ -458,24 +458,28 @@ "te-delay-metric": 1, "max-link-bandwidth": { "te-bandwidth": { - "ietf-otn-topology:odulist": [ - { - "odu-type": "ietf-layer1-types:ODU0", - "number": 80 - } - ] + "ietf-otn-topology:otn": { + "odulist": [ + { + "odu-type": "ietf-layer1-types:ODU0", + "ts-number": 80 + } + ] + } } }, "unreserved-bandwidth": [ { "priority": 7, "te-bandwidth": { - "ietf-otn-topology:odulist": [ - { - "number": 80, - "odu-type": "ietf-layer1-types:ODU0" - } - ] + "ietf-otn-topology:otn": { + "odulist": [ + { + "ts-number": 80, + "odu-type": "ietf-layer1-types:ODU0" + } + ] + } } } ] @@ -501,24 +505,28 @@ "te-delay-metric": 1, "max-link-bandwidth": { "te-bandwidth": { - "ietf-otn-topology:odulist": [ - { - "odu-type": "ietf-layer1-types:ODU0", - "number": 80 - } - ] + "ietf-otn-topology:otn": { + "odulist": [ + { + "odu-type": "ietf-layer1-types:ODU0", + "ts-number": 80 + } + ] + } } }, "unreserved-bandwidth": [ { "priority": 7, "te-bandwidth": { - "ietf-otn-topology:odulist": [ - { - "number": 80, - "odu-type": "ietf-layer1-types:ODU0" - } - ] + "ietf-otn-topology:otn": { + "odulist": [ + { + "ts-number": 80, + "odu-type": "ietf-layer1-types:ODU0" + } + ] + } } } ] @@ -544,24 +552,28 @@ "te-delay-metric": 1, "max-link-bandwidth": { "te-bandwidth": { - "ietf-otn-topology:odulist": [ - { - "odu-type": "ietf-layer1-types:ODU0", - "number": 80 - } - ] + "ietf-otn-topology:otn": { + "odulist": [ + { + "odu-type": "ietf-layer1-types:ODU0", + "ts-number": 80 + } + ] + } } }, "unreserved-bandwidth": [ { "priority": 7, "te-bandwidth": { - "ietf-otn-topology:odulist": [ - { - "number": 80, - "odu-type": "ietf-layer1-types:ODU0" - } - ] + "ietf-otn-topology:otn": { + "odulist": [ + { + "ts-number": 80, + "odu-type": "ietf-layer1-types:ODU0" + } + ] + } } } ] @@ -587,24 +599,28 @@ "te-delay-metric": 1, "max-link-bandwidth": { "te-bandwidth": { - "ietf-otn-topology:odulist": [ - { - "odu-type": "ietf-layer1-types:ODU0", - "number": 80 - } - ] + "ietf-otn-topology:otn": { + "odulist": [ + { + "odu-type": "ietf-layer1-types:ODU0", + "ts-number": 80 + } + ] + } } }, "unreserved-bandwidth": [ { "priority": 7, "te-bandwidth": { - "ietf-otn-topology:odulist": [ - { - "number": 80, - "odu-type": "ietf-layer1-types:ODU0" - } - ] + "ietf-otn-topology:otn": { + "odulist": [ + { + "ts-number": 80, + "odu-type": "ietf-layer1-types:ODU0" + } + ] + } } } ] @@ -630,24 +646,28 @@ "te-delay-metric": 1, "max-link-bandwidth": { "te-bandwidth": { - "ietf-otn-topology:odulist": [ - { - "odu-type": "ietf-layer1-types:ODU0", - "number": 80 - } - ] + "ietf-otn-topology:otn": { + "odulist": [ + { + "odu-type": "ietf-layer1-types:ODU0", + "ts-number": 80 + } + ] + } } }, "unreserved-bandwidth": [ { "priority": 7, "te-bandwidth": { - "ietf-otn-topology:odulist": [ - { - "number": 80, - "odu-type": "ietf-layer1-types:ODU0" - } - ] + "ietf-otn-topology:otn": { + "odulist": [ + { + "ts-number": 80, + "odu-type": "ietf-layer1-types:ODU0" + } + ] + } } } ] @@ -673,24 +693,28 @@ "te-delay-metric": 1, "max-link-bandwidth": { "te-bandwidth": { - "ietf-otn-topology:odulist": [ - { - "odu-type": "ietf-layer1-types:ODU0", - "number": 80 - } - ] + "ietf-otn-topology:otn": { + "odulist": [ + { + "odu-type": "ietf-layer1-types:ODU0", + "ts-number": 80 + } + ] + } } }, "unreserved-bandwidth": [ { "priority": 7, "te-bandwidth": { - "ietf-otn-topology:odulist": [ - { - "number": 80, - "odu-type": "ietf-layer1-types:ODU0" - } - ] + "ietf-otn-topology:otn": { + "odulist": [ + { + "ts-number": 80, + "odu-type": "ietf-layer1-types:ODU0" + } + ] + } } } ] @@ -716,24 +740,28 @@ "te-delay-metric": 1, "max-link-bandwidth": { "te-bandwidth": { - "ietf-otn-topology:odulist": [ - { - "odu-type": "ietf-layer1-types:ODU0", - "number": 80 - } - ] + "ietf-otn-topology:otn": { + "odulist": [ + { + "odu-type": "ietf-layer1-types:ODU0", + "ts-number": 80 + } + ] + } } }, "unreserved-bandwidth": [ { "priority": 7, "te-bandwidth": { - "ietf-otn-topology:odulist": [ - { - "number": 80, - "odu-type": "ietf-layer1-types:ODU0" - } - ] + "ietf-otn-topology:otn": { + "odulist": [ + { + "ts-number": 80, + "odu-type": "ietf-layer1-types:ODU0" + } + ] + } } } ] @@ -759,24 +787,28 @@ "te-delay-metric": 1, "max-link-bandwidth": { "te-bandwidth": { - "ietf-otn-topology:odulist": [ - { - "odu-type": "ietf-layer1-types:ODU0", - "number": 80 - } - ] + "ietf-otn-topology:otn": { + "odulist": [ + { + "odu-type": "ietf-layer1-types:ODU0", + "ts-number": 80 + } + ] + } } }, "unreserved-bandwidth": [ { "priority": 7, "te-bandwidth": { - "ietf-otn-topology:odulist": [ - { - "number": 80, - "odu-type": "ietf-layer1-types:ODU0" - } - ] + "ietf-otn-topology:otn": { + "odulist": [ + { + "ts-number": 80, + "odu-type": "ietf-layer1-types:ODU0" + } + ] + } } } ] @@ -1941,4 +1973,4 @@ } ] } -} +} \ No newline at end of file diff --git a/src/nbi/tests/data/topology_dummy.json b/src/nbi/tests/data/topology-dummy.json similarity index 95% rename from src/nbi/tests/data/topology_dummy.json rename to src/nbi/tests/data/topology-dummy.json index 342124405..3ee8bf69a 100644 --- a/src/nbi/tests/data/topology_dummy.json +++ b/src/nbi/tests/data/topology-dummy.json @@ -6,9 +6,36 @@ ], "topologies": [ - {"topology_id": {"topology_uuid": {"uuid": "admin" }, "context_id": {"context_uuid": {"uuid": "admin"}}}, "name": "admin" }, - {"topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}, "name": "providerId-10-clientId-0-topologyId-1"}, - {"topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-2"}, "context_id": {"context_uuid": {"uuid": "admin"}}}, "name": "providerId-10-clientId-0-topologyId-2"} + { + "topology_id": { + "context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "admin"} + }, + "name": "admin" + }, + { + "topology_id": { + "context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"} + }, + "name": "providerId-10-clientId-0-topologyId-1", + "device_ids": [ + {"device_uuid": {"uuid": "10.0.10.1"}}, + {"device_uuid": {"uuid": "10.0.20.1"}}, + {"device_uuid": {"uuid": "10.0.30.1"}}, + {"device_uuid": {"uuid": "10.0.40.1"}} + ] + }, + { + "topology_id": { + "context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-2"} + }, + "name": "providerId-10-clientId-0-topologyId-2", + "device_ids": [ + {"device_uuid": {"uuid": "10.0.10.1"}}, + {"device_uuid": {"uuid": "10.0.20.1"}}, + {"device_uuid": {"uuid": "10.0.30.1"}}, + {"device_uuid": {"uuid": "10.0.40.1"}} + ] + } ], "devices": [ diff --git a/src/nbi/tests/data/topology-real.json b/src/nbi/tests/data/topology-real.json index 609e21288..a5a5562fc 100644 --- a/src/nbi/tests/data/topology-real.json +++ b/src/nbi/tests/data/topology-real.json @@ -4,9 +4,36 @@ ], "topologies": [ - {"topology_id": {"topology_uuid": {"uuid": "admin" }, "context_id": {"context_uuid": {"uuid": "admin"}}}, "name": "admin" }, - {"topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}, "name": "providerId-10-clientId-0-topologyId-1"}, - {"topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-2"}, "context_id": {"context_uuid": {"uuid": "admin"}}}, "name": "providerId-10-clientId-0-topologyId-2"} + { + "topology_id": { + "context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "admin"} + }, + "name": "admin" + }, + { + "topology_id": { + "context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"} + }, + "name": "providerId-10-clientId-0-topologyId-1", + "device_ids": [ + {"device_uuid": {"uuid": "10.0.10.1"}}, + {"device_uuid": {"uuid": "10.0.20.1"}}, + {"device_uuid": {"uuid": "10.0.30.1"}}, + {"device_uuid": {"uuid": "10.0.40.1"}} + ] + }, + { + "topology_id": { + "context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-2"} + }, + "name": "providerId-10-clientId-0-topologyId-2", + "device_ids": [ + {"device_uuid": {"uuid": "10.0.10.1"}}, + {"device_uuid": {"uuid": "10.0.20.1"}}, + {"device_uuid": {"uuid": "10.0.30.1"}}, + {"device_uuid": {"uuid": "10.0.40.1"}} + ] + } ], "devices": [ -- GitLab From f1dcf6e09099e65b27908a8b0cd2613cfecb7943 Mon Sep 17 00:00:00 2001 From: gifrerenom Date: Fri, 15 Dec 2023 16:39:10 +0000 Subject: [PATCH 09/16] NBI Component: - Updated unitary test launcher scripts --- scripts/run_tests_locally-nbi-ietf-network.sh | 27 +++++++++++++++++++ scripts/run_tests_locally-nbi.sh | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100755 scripts/run_tests_locally-nbi-ietf-network.sh diff --git a/scripts/run_tests_locally-nbi-ietf-network.sh b/scripts/run_tests_locally-nbi-ietf-network.sh new file mode 100755 index 000000000..5c7b7bfa3 --- /dev/null +++ b/scripts/run_tests_locally-nbi-ietf-network.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc + +# Run unitary tests and analyze coverage of code at same time +#coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ +# nbi/tests/test_unitary.py + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + nbi/tests/test_ietf_network.py diff --git a/scripts/run_tests_locally-nbi.sh b/scripts/run_tests_locally-nbi.sh index 5c7b7bfa3..dd37be399 100755 --- a/scripts/run_tests_locally-nbi.sh +++ b/scripts/run_tests_locally-nbi.sh @@ -24,4 +24,4 @@ RCFILE=$PROJECTDIR/coverage/.coveragerc # nbi/tests/test_unitary.py coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ - nbi/tests/test_ietf_network.py + nbi/tests/test_unitary.py -- GitLab From a60a599a895f137b80e2c81b0646cf32399b4d89 Mon Sep 17 00:00:00 2001 From: gifrerenom Date: Fri, 15 Dec 2023 16:40:08 +0000 Subject: [PATCH 10/16] NBI Component: - Updated unitary test launcher scripts --- scripts/run_tests_locally-nbi-ietf-network.sh | 3 --- scripts/run_tests_locally-nbi.sh | 3 --- 2 files changed, 6 deletions(-) diff --git a/scripts/run_tests_locally-nbi-ietf-network.sh b/scripts/run_tests_locally-nbi-ietf-network.sh index 5c7b7bfa3..7193dd727 100755 --- a/scripts/run_tests_locally-nbi-ietf-network.sh +++ b/scripts/run_tests_locally-nbi-ietf-network.sh @@ -20,8 +20,5 @@ cd $PROJECTDIR/src RCFILE=$PROJECTDIR/coverage/.coveragerc # Run unitary tests and analyze coverage of code at same time -#coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ -# nbi/tests/test_unitary.py - coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ nbi/tests/test_ietf_network.py diff --git a/scripts/run_tests_locally-nbi.sh b/scripts/run_tests_locally-nbi.sh index dd37be399..1be045158 100755 --- a/scripts/run_tests_locally-nbi.sh +++ b/scripts/run_tests_locally-nbi.sh @@ -20,8 +20,5 @@ cd $PROJECTDIR/src RCFILE=$PROJECTDIR/coverage/.coveragerc # Run unitary tests and analyze coverage of code at same time -#coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ -# nbi/tests/test_unitary.py - coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ nbi/tests/test_unitary.py -- GitLab From fe92a91c8be08d1bb038844999267bbbe7b704e4 Mon Sep 17 00:00:00 2001 From: gifrerenom Date: Fri, 15 Dec 2023 17:48:19 +0000 Subject: [PATCH 11/16] NBI Component: - Extended node composer with tunnel termination points - Updated TODO.txt --- .../nbi_plugins/ietf_network/ComposeNode.py | 42 ++++++++ .../nbi_plugins/ietf_network/TODO.txt | 96 +++++-------------- 2 files changed, 66 insertions(+), 72 deletions(-) diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeNode.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeNode.py index 3f000f2d8..7467abb0e 100644 --- a/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeNode.py +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeNode.py @@ -49,3 +49,45 @@ def compose_node( ietf_tp_obj = ietf_node_obj.termination_point.add(endpoint_name) compose_term_point(ietf_tp_obj, device, endpoint, name_mappings, network_type) + + if network_type == NetworkTypeEnum.TE_OTN_TOPOLOGY: + if device_name in {'10.0.30.1', '10.0.40.1'}: + ntaw = ietf_node_obj.te.tunnel_termination_point.add('NTAw') + ntaw.admin_status = 'up' + ntaw.encoding = 'ietf-te-types:lsp-encoding-oduk' + ntaw_llc = ntaw.local_link_connectivities.local_link_connectivity.add('500') + ntaw_llc.is_allowed = True + ntaw.name = '1-1-1-1-1' + ntaw._set_oper_status('up') + ntaw.protection_type = 'ietf-te-types:lsp-protection-unprotected' + ntaw.switching_capability = 'ietf-te-types:switching-otn' + + ntax = ietf_node_obj.te.tunnel_termination_point.add('NTAx') + ntax.admin_status = 'up' + ntax.encoding = 'ietf-te-types:lsp-encoding-oduk' + ntax_llc = ntax.local_link_connectivities.local_link_connectivity.add('501') + ntax_llc.is_allowed = True + ntax.name = '1-1-1-1-1' + ntax._set_oper_status('up') + ntax.protection_type = 'ietf-te-types:lsp-protection-unprotected' + ntax.switching_capability = 'ietf-te-types:switching-otn' + elif device_name in {'10.0.10.1', '10.0.20.1'}: + ntax = ietf_node_obj.te.tunnel_termination_point.add('NTAx') + ntax.admin_status = 'up' + ntax.encoding = 'ietf-te-types:lsp-encoding-oduk' + ntax_llc = ntax.local_link_connectivities.local_link_connectivity.add('501') + ntax_llc.is_allowed = True + ntax.name = '1-1-1-1-1' + ntax._set_oper_status('up') + ntax.protection_type = 'ietf-te-types:lsp-protection-unprotected' + ntax.switching_capability = 'ietf-te-types:switching-otn' + + ntaw = ietf_node_obj.te.tunnel_termination_point.add('NTAw') + ntaw.admin_status = 'up' + ntaw.encoding = 'ietf-te-types:lsp-encoding-oduk' + ntaw_llc = ntaw.local_link_connectivities.local_link_connectivity.add('500') + ntaw_llc.is_allowed = True + ntaw.name = '1-1-1-1-1' + ntaw._set_oper_status('up') + ntaw.protection_type = 'ietf-te-types:lsp-protection-unprotected' + ntaw.switching_capability = 'ietf-te-types:switching-otn' diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/TODO.txt b/src/nbi/service/rest_server/nbi_plugins/ietf_network/TODO.txt index dc03b0623..12d35c01c 100644 --- a/src/nbi/service/rest_server/nbi_plugins/ietf_network/TODO.txt +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/TODO.txt @@ -1,73 +1,25 @@ -WARNING src.nbi.tests.test_ietf_network:PrepareTestScenario.py:90 Request: GET http://admin:admin@127.0.0.1:18080/restconf/data/ietf-network:networks -INFO nbi.service.rest_server.RestServer:GenericRestServer.py:27 [2023-Dec-13 18:33] 127.0.0.1 GET /restconf/data/ietf-network:networks? 308 PERMANENT REDIRECT -INFO nbi.service.rest_server.nbi_plugins.ietf_network.Networks:Networks.py:41 Request: -INFO nbi.service.rest_server.RestServer:GenericRestServer.py:27 [2023-Dec-13 18:33] 127.0.0.1 GET /restconf/data/ietf-network:networks/? 200 OK -WARNING src.nbi.tests.test_ietf_network:PrepareTestScenario.py:93 Reply: {"ietf-network:networks":{"network":[{"ietf-network-topology:link":[{"destination":{"dest-node":"10.0.20.1","dest-tp":"501"},"link-id":"10.0.10.1-501","source":{"source-node":"10.0.10.1","source-tp":"501"}},{"destination":{"dest-node":"10.0.10.1","dest-tp":"501"},"link-id":"10.0.20.1-501","source":{"source-node":"10.0.20.1","source-tp":"501"}},{"destination":{"dest-node":"10.0.40.1","dest-tp":"500"},"link-id":"10.0.10.1-500","source":{"source-node":"10.0.10.1","source-tp":"500"}},{"destination":{"dest-node":"10.0.10.1","dest-tp":"500"},"link-id":"10.0.40.1-500","source":{"source-node":"10.0.40.1","source-tp":"500"}},{"destination":{"dest-node":"10.0.30.1","dest-tp":"500"},"link-id":"10.0.20.1-500","source":{"source-node":"10.0.20.1","source-tp":"500"}},{"destination":{"dest-node":"10.0.20.1","dest-tp":"500"},"link-id":"10.0.30.1-500","source":{"source-node":"10.0.30.1","source-tp":"500"}},{"destination":{"dest-node":"10.0.30.1","dest-tp":"501"},"link-id":"10.0.40.1-501","source":{"source-node":"10.0.40.1","source-tp":"501"}},{"destination":{"dest-node":"10.0.40.1","dest-tp":"501"},"link-id":"10.0.30.1-501","source":{"source-node":"10.0.30.1","source-tp":"501"}}],"ietf-te-topology:te":{"name":"Huawei-Network"},"ietf-te-topology:te-topology-identifier":{"client-id":0,"provider-id":10,"topology-id":"1"},"network-id":"providerId-10-clientId-0-topologyId-1","network-types":{"ietf-te-topology:te-topology":{"ietf-otn-topology:otn-topology":{}}},"node":[{"ietf-network-topology:termination-point":[{"tp-id":"200"},{"tp-id":"500"},{"tp-id":"501"}],"ietf-te-topology:te-node-id":"10.0.30.1","node-id":"10.0.30.1"},{"ietf-network-topology:termination-point":[{"tp-id":"501"},{"tp-id":"500"}],"ietf-te-topology:te-node-id":"10.0.40.1","node-id":"10.0.40.1"},{"ietf-network-topology:termination-point":[{"tp-id":"501"},{"tp-id":"200"},{"tp-id":"500"}],"ietf-te-topology:te-node-id":"10.0.10.1","node-id":"10.0.10.1"},{"ietf-network-topology:termination-point":[{"tp-id":"500"},{"tp-id":"501"}],"ietf-te-topology:te-node-id":"10.0.20.1","node-id":"10.0.20.1"}]},{"ietf-te-topology:te":{"name":"Huawei-Network"},"ietf-te-topology:te-topology-identifier":{"client-id":0,"provider-id":10,"topology-id":"2"},"network-id":"providerId-10-clientId-0-topologyId-2","network-types":{"ietf-te-topology:te-topology":{"ietf-eth-te-topology:eth-tran-topology":{}}},"node":[{"ietf-network-topology:termination-point":[{"tp-id":"200"},{"tp-id":"500"},{"tp-id":"501"}],"ietf-te-topology:te-node-id":"10.0.30.1","node-id":"10.0.30.1"},{"ietf-network-topology:termination-point":[{"tp-id":"501"},{"tp-id":"200"},{"tp-id":"500"}],"ietf-te-topology:te-node-id":"10.0.10.1","node-id":"10.0.10.1"}]}]}} +cd ~/tfs-ctrl/src/nbi/service/rest_server/nbi_plugins/ietf_network -ERROR src.nbi.tests.test_ietf_network:test_ietf_network.py:85 Differences: -Item root['ietf-network:networks']['network'][0]['ietf-network-topology:link'][0]['ietf-te-topology:te'] removed from dictionary. -Item root['ietf-network:networks']['network'][0]['ietf-network-topology:link'][1]['ietf-te-topology:te'] removed from dictionary. -Item root['ietf-network:networks']['network'][0]['ietf-network-topology:link'][2]['ietf-te-topology:te'] removed from dictionary. -Item root['ietf-network:networks']['network'][0]['ietf-network-topology:link'][3]['ietf-te-topology:te'] removed from dictionary. -Item root['ietf-network:networks']['network'][0]['ietf-network-topology:link'][4]['ietf-te-topology:te'] removed from dictionary. -Item root['ietf-network:networks']['network'][0]['ietf-network-topology:link'][5]['ietf-te-topology:te'] removed from dictionary. -Item root['ietf-network:networks']['network'][0]['ietf-network-topology:link'][6]['ietf-te-topology:te'] removed from dictionary. -Item root['ietf-network:networks']['network'][0]['ietf-network-topology:link'][7]['ietf-te-topology:te'] removed from dictionary. -Item root['ietf-network:networks']['network'][0]['node'][0]['ietf-te-topology:te'] removed from dictionary. -Item root['ietf-network:networks']['network'][0]['node'][0]['ietf-network-topology:termination-point'][0]['ietf-te-topology:te-tp-id'] removed from dictionary. -Item root['ietf-network:networks']['network'][0]['node'][0]['ietf-network-topology:termination-point'][0]['ietf-te-topology:te'] removed from dictionary. -Item root['ietf-network:networks']['network'][0]['node'][0]['ietf-network-topology:termination-point'][1]['ietf-te-topology:te-tp-id'] removed from dictionary. -Item root['ietf-network:networks']['network'][0]['node'][0]['ietf-network-topology:termination-point'][1]['ietf-te-topology:te'] removed from dictionary. -Item root['ietf-network:networks']['network'][0]['node'][1]['ietf-te-topology:te'] removed from dictionary. -Item root['ietf-network:networks']['network'][0]['node'][1]['ietf-network-topology:termination-point'][0]['ietf-te-topology:te-tp-id'] removed from dictionary. -Item root['ietf-network:networks']['network'][0]['node'][1]['ietf-network-topology:termination-point'][0]['ietf-te-topology:te'] removed from dictionary. -Item root['ietf-network:networks']['network'][0]['node'][1]['ietf-network-topology:termination-point'][1]['ietf-te-topology:te-tp-id'] removed from dictionary. -Item root['ietf-network:networks']['network'][0]['node'][1]['ietf-network-topology:termination-point'][1]['ietf-te-topology:te'] removed from dictionary. -Item root['ietf-network:networks']['network'][0]['node'][2]['ietf-te-topology:te'] removed from dictionary. -Item root['ietf-network:networks']['network'][0]['node'][2]['ietf-network-topology:termination-point'][0]['ietf-te-topology:te-tp-id'] removed from dictionary. -Item root['ietf-network:networks']['network'][0]['node'][2]['ietf-network-topology:termination-point'][0]['ietf-te-topology:te'] removed from dictionary. -Item root['ietf-network:networks']['network'][0]['node'][2]['ietf-network-topology:termination-point'][1]['ietf-te-topology:te-tp-id'] removed from dictionary. -Item root['ietf-network:networks']['network'][0]['node'][2]['ietf-network-topology:termination-point'][1]['ietf-te-topology:te'] removed from dictionary. -Item root['ietf-network:networks']['network'][0]['node'][3]['ietf-te-topology:te'] removed from dictionary. -Item root['ietf-network:networks']['network'][0]['node'][3]['ietf-network-topology:termination-point'][0]['ietf-te-topology:te-tp-id'] removed from dictionary. -Item root['ietf-network:networks']['network'][0]['node'][3]['ietf-network-topology:termination-point'][0]['ietf-te-topology:te'] removed from dictionary. -Item root['ietf-network:networks']['network'][0]['node'][3]['ietf-network-topology:termination-point'][1]['ietf-te-topology:te-tp-id'] removed from dictionary. -Item root['ietf-network:networks']['network'][0]['node'][3]['ietf-network-topology:termination-point'][1]['ietf-te-topology:te'] removed from dictionary. -Item root['ietf-network:networks']['network'][1]['ietf-network-topology:link'] removed from dictionary. -Item root['ietf-network:networks']['network'][1]['node'][0]['ietf-te-topology:te'] removed from dictionary. -Item root['ietf-network:networks']['network'][1]['node'][0]['ietf-network-topology:termination-point'][0]['ietf-te-topology:te-tp-id'] removed from dictionary. -Item root['ietf-network:networks']['network'][1]['node'][0]['ietf-network-topology:termination-point'][0]['ietf-eth-te-topology:eth-svc'] removed from dictionary. -Item root['ietf-network:networks']['network'][1]['node'][0]['ietf-network-topology:termination-point'][0]['ietf-te-topology:te'] removed from dictionary. -Item root['ietf-network:networks']['network'][1]['node'][0]['ietf-network-topology:termination-point'][1]['ietf-te-topology:te-tp-id'] removed from dictionary. -Item root['ietf-network:networks']['network'][1]['node'][0]['ietf-network-topology:termination-point'][1]['ietf-eth-te-topology:eth-svc'] removed from dictionary. -Item root['ietf-network:networks']['network'][1]['node'][0]['ietf-network-topology:termination-point'][1]['ietf-te-topology:te'] removed from dictionary. -Item root['ietf-network:networks']['network'][1]['node'][0]['ietf-network-topology:termination-point'][2]['ietf-te-topology:te-tp-id'] removed from dictionary. -Item root['ietf-network:networks']['network'][1]['node'][0]['ietf-network-topology:termination-point'][2]['ietf-eth-te-topology:eth-svc'] removed from dictionary. -Item root['ietf-network:networks']['network'][1]['node'][0]['ietf-network-topology:termination-point'][2]['ietf-te-topology:te'] removed from dictionary. -Item root['ietf-network:networks']['network'][1]['node'][1]['ietf-te-topology:te'] removed from dictionary. -Item root['ietf-network:networks']['network'][1]['node'][1]['ietf-network-topology:termination-point'][0]['ietf-te-topology:te-tp-id'] removed from dictionary. -Item root['ietf-network:networks']['network'][1]['node'][1]['ietf-network-topology:termination-point'][0]['ietf-eth-te-topology:eth-svc'] removed from dictionary. -Item root['ietf-network:networks']['network'][1]['node'][1]['ietf-network-topology:termination-point'][0]['ietf-te-topology:te'] removed from dictionary. -Item root['ietf-network:networks']['network'][1]['node'][1]['ietf-network-topology:termination-point'][1]['ietf-te-topology:te-tp-id'] removed from dictionary. -Item root['ietf-network:networks']['network'][1]['node'][1]['ietf-network-topology:termination-point'][1]['ietf-eth-te-topology:eth-svc'] removed from dictionary. -Item root['ietf-network:networks']['network'][1]['node'][1]['ietf-network-topology:termination-point'][1]['ietf-te-topology:te'] removed from dictionary. -Item root['ietf-network:networks']['network'][0]['node'][0]['ietf-network-topology:termination-point'][2] added to iterable. -Item root['ietf-network:networks']['network'][0]['node'][2]['ietf-network-topology:termination-point'][2] added to iterable. -Item root['ietf-network:networks']['network'][1]['node'][1]['ietf-network-topology:termination-point'][2] added to iterable. -Item root['ietf-network:networks']['network'][1]['node'][2] removed from iterable. -Item root['ietf-network:networks']['network'][1]['node'][3] removed from iterable. -Item root['ietf-network:networks']['network'][1]['node'][4] removed from iterable. -Item root['ietf-network:networks']['network'][1]['node'][5] removed from iterable. -Item root['ietf-network:networks']['network'][1]['node'][6] removed from iterable. -Value of root['ietf-network:networks']['network'][0]['node'][0]['ietf-network-topology:termination-point'][1]['tp-id'] changed from "500" to "200". -Value of root['ietf-network:networks']['network'][0]['node'][1]['ietf-network-topology:termination-point'][0]['tp-id'] changed from "501" to "500". -Value of root['ietf-network:networks']['network'][0]['node'][1]['ietf-network-topology:termination-point'][1]['tp-id'] changed from "500" to "501". -Value of root['ietf-network:networks']['network'][0]['node'][2]['ietf-network-topology:termination-point'][0]['tp-id'] changed from "500" to "200". -Value of root['ietf-network:networks']['network'][0]['node'][2]['ietf-network-topology:termination-point'][1]['tp-id'] changed from "501" to "500". -Value of root['ietf-network:networks']['network'][0]['node'][3]['ietf-network-topology:termination-point'][0]['tp-id'] changed from "500" to "501". -Value of root['ietf-network:networks']['network'][0]['node'][3]['ietf-network-topology:termination-point'][1]['tp-id'] changed from "501" to "500". -Value of root['ietf-network:networks']['network'][1]['node'][0]['ietf-network-topology:termination-point'][0]['tp-id'] changed from "200" to "501". -Value of root['ietf-network:networks']['network'][1]['node'][0]['ietf-network-topology:termination-point'][1]['tp-id'] changed from "501" to "200". -Value of root['ietf-network:networks']['network'][1]['node'][1]['ietf-network-topology:termination-point'][0]['tp-id'] changed from "501" to "200". -Value of root['ietf-network:networks']['network'][1]['node'][1]['ietf-te-topology:te-node-id'] changed from "10.0.20.1" to "10.0.30.1". -Value of root['ietf-network:networks']['network'][1]['node'][1]['node-id'] changed from "10.0.20.1" to "10.0.30.1". +python + +from bindings import ietf_network +import pyangbind.lib.pybindJSON as pybindJSON + +ietf_nets_obj = ietf_network() +ietf_net_obj = ietf_nets_obj.networks.network.add('my-topo') + +ietf_node_obj = ietf_net_obj.node.add('my-node') +ietf_tp_obj = ietf_node_obj.termination_point.add('my-tp') + +ietf_link_obj = ietf_net_obj.link.add('my-link') + +ietf_link_obj.te._set_oper_status('up') +print(pybindJSON.dumps(ietf_nets_obj, mode='ietf')) + +ietf_link_obj.te.te_link_attributes.admin_status = 'down' +print(pybindJSON.dumps(ietf_nets_obj, mode='ietf')) + + +ietf_link_obj.te.te_link_attributes.max_link_bandwidth.te_bandwidth.eth_bandwidth = 10_000_000 # Kbps +unresv_bw = ietf_link_obj.te.te_link_attributes.unreserved_bandwidth.add(7) +unresv_bw.te_bandwidth.eth_bandwidth = 10_000_000 # Kbps -- GitLab From 04f63033cf2221fff0205c2ba6a033d3042d038c Mon Sep 17 00:00:00 2001 From: gifrerenom Date: Fri, 15 Dec 2023 17:48:57 +0000 Subject: [PATCH 12/16] Common - Tests - Mock Context: - Added merge of device_ids and link_ids in Topology --- src/common/tests/MockServicerImpl_Context.py | 28 ++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/common/tests/MockServicerImpl_Context.py b/src/common/tests/MockServicerImpl_Context.py index 837445b5a..209621887 100644 --- a/src/common/tests/MockServicerImpl_Context.py +++ b/src/common/tests/MockServicerImpl_Context.py @@ -26,6 +26,8 @@ from common.proto.context_pb2 import ( Topology, TopologyDetails, TopologyEvent, TopologyId, TopologyIdList, TopologyList) from common.proto.context_pb2_grpc import ContextServiceServicer from common.tools.grpc.Tools import grpc_message_to_json, grpc_message_to_json_string +from common.tools.object_factory.Device import json_device_id +from common.tools.object_factory.Link import json_link_id from .InMemoryObjectDatabase import InMemoryObjectDatabase from .MockMessageBroker import ( TOPIC_CONNECTION, TOPIC_CONTEXT, TOPIC_DEVICE, TOPIC_LINK, TOPIC_SERVICE, TOPIC_SLICE, TOPIC_TOPOLOGY, @@ -146,6 +148,32 @@ class MockServicerImpl_Context(ContextServiceServicer): context_uuid = str(request.topology_id.context_id.context_uuid.uuid) container_name = 'topology[{:s}]'.format(context_uuid) topology_uuid = request.topology_id.topology_uuid.uuid + + if self.obj_db.has_entry(container_name, topology_uuid): + # merge device_ids and link_ids from database and request, and update request + db_topology = self.obj_db.get_entry(container_name, topology_uuid, context) + + device_uuids = set() + for device_id in request.device_ids: device_uuids.add(device_id.device_uuid.uuid) + for device_id in db_topology.device_ids: device_uuids.add(device_id.device_uuid.uuid) + + link_uuids = set() + for link_id in request.link_ids: link_uuids.add(link_id.link_uuid.uuid) + for link_id in db_topology.link_ids: link_uuids.add(link_id.link_uuid.uuid) + + rw_request = Topology() + rw_request.CopyFrom(request) + + del rw_request.device_ids[:] + for device_uuid in sorted(device_uuids): + rw_request.device_ids.append(DeviceId(**json_device_id(device_uuid))) + + del rw_request.link_ids[:] + for link_uuid in sorted(link_uuids): + rw_request.link_ids.append(LinkId(**json_link_id(link_uuid))) + + request = rw_request + reply,_ = self._set(request, container_name, topology_uuid, 'topology_id', TOPIC_TOPOLOGY) context_ = self.obj_db.get_entry('context', context_uuid, context) -- GitLab From 8ce6153b14c1aa26d37af0991894fba121c6d0bf Mon Sep 17 00:00:00 2001 From: gifrerenom Date: Wed, 20 Dec 2023 10:43:35 +0000 Subject: [PATCH 13/16] NBI Component - IETF Network plugin: - Added example flags in run_tests_locally script - Added data model bindings - Fixed Composer methods - Updated ManualFixes.py - Updated unitary test - Renamed TODO.txt to test_commands.txt --- scripts/run_tests_locally-nbi-ietf-network.sh | 1 + .../ietf_network/ComposeNetwork.py | 59 +- .../nbi_plugins/ietf_network/ComposeNode.py | 30 +- .../ietf_network/ComposeTermPoint.py | 36 +- .../nbi_plugins/ietf_network/ManualFixes.py | 31 +- .../nbi_plugins/ietf_network/Networks.py | 33 +- .../{TODO.txt => _docs/test_commands.txt} | 1 + .../ietf_network/bindings/__init__.py | 256 +++++ .../bindings/networks/__init__.py | 162 +++ .../bindings/networks/network/__init__.py | 385 +++++++ .../networks/network/link/__init__.py | 294 ++++++ .../network/link/destination/__init__.py | 159 +++ .../networks/network/link/source/__init__.py | 157 +++ .../network/link/supporting_link/__init__.py | 172 ++++ .../networks/network/link/te/__init__.py | 603 +++++++++++ .../network/link/te/bundled_links/__init__.py | 118 +++ .../te/bundled_links/bundled_link/__init__.py | 203 ++++ .../link/te/component_links/__init__.py | 120 +++ .../component_link/__init__.py | 204 ++++ .../te/information_source_entry/__init__.py | 749 ++++++++++++++ .../information_source_state/__init__.py | 248 +++++ .../topology/__init__.py | 162 +++ .../__init__.py | 206 ++++ .../max_lsp_bandwidth/__init__.py | 163 +++ .../te_bandwidth/__init__.py | 195 ++++ .../te_bandwidth/otn/__init__.py | 156 +++ .../label_restrictions/__init__.py | 120 +++ .../label_restriction/__init__.py | 450 +++++++++ .../ethernet_label_range/__init__.py | 154 +++ .../label_restriction/label_end/__init__.py | 119 +++ .../label_end/te_label/__init__.py | 234 +++++ .../label_end/te_label/otn/__init__.py | 154 +++ .../label_restriction/label_start/__init__.py | 120 +++ .../label_start/te_label/__init__.py | 234 +++++ .../label_start/te_label/otn/__init__.py | 154 +++ .../label_restriction/label_step/__init__.py | 200 ++++ .../label_step/otn/__init__.py | 158 +++ .../otn_label_range/__init__.py | 256 +++++ .../max_link_bandwidth/__init__.py | 119 +++ .../te_bandwidth/__init__.py | 195 ++++ .../te_bandwidth/otn/__init__.py | 116 +++ .../te_bandwidth/otn/odulist/__init__.py | 200 ++++ .../max_resv_link_bandwidth/__init__.py | 119 +++ .../te_bandwidth/__init__.py | 195 ++++ .../te_bandwidth/otn/__init__.py | 116 +++ .../te_bandwidth/otn/odulist/__init__.py | 200 ++++ .../te_nsrlgs/__init__.py | 118 +++ .../te_srlgs/__init__.py | 115 +++ .../unreserved_bandwidth/__init__.py | 163 +++ .../te_bandwidth/__init__.py | 195 ++++ .../te_bandwidth/otn/__init__.py | 116 +++ .../te_bandwidth/otn/odulist/__init__.py | 200 ++++ .../te/information_source_state/__init__.py | 248 +++++ .../topology/__init__.py | 162 +++ .../network/link/te/recovery/__init__.py | 154 +++ .../network/link/te/statistics/__init__.py | 810 +++++++++++++++ .../link/te/te_link_attributes/__init__.py | 938 ++++++++++++++++++ .../te_link_attributes/client_svc/__init__.py | 115 +++ .../external_domain/__init__.py | 205 ++++ .../__init__.py | 206 ++++ .../max_lsp_bandwidth/__init__.py | 163 +++ .../te_bandwidth/__init__.py | 195 ++++ .../te_bandwidth/otn/__init__.py | 156 +++ .../label_restrictions/__init__.py | 120 +++ .../label_restriction/__init__.py | 450 +++++++++ .../ethernet_label_range/__init__.py | 154 +++ .../label_restriction/label_end/__init__.py | 119 +++ .../label_end/te_label/__init__.py | 234 +++++ .../label_end/te_label/otn/__init__.py | 154 +++ .../label_restriction/label_start/__init__.py | 120 +++ .../label_start/te_label/__init__.py | 234 +++++ .../label_start/te_label/otn/__init__.py | 154 +++ .../label_restriction/label_step/__init__.py | 200 ++++ .../label_step/otn/__init__.py | 158 +++ .../otn_label_range/__init__.py | 256 +++++ .../max_link_bandwidth/__init__.py | 119 +++ .../te_bandwidth/__init__.py | 195 ++++ .../te_bandwidth/otn/__init__.py | 116 +++ .../te_bandwidth/otn/odulist/__init__.py | 200 ++++ .../max_resv_link_bandwidth/__init__.py | 119 +++ .../te_bandwidth/__init__.py | 195 ++++ .../te_bandwidth/otn/__init__.py | 116 +++ .../te_bandwidth/otn/odulist/__init__.py | 200 ++++ .../te_link_attributes/otn_link/__init__.py | 199 ++++ .../te_link_attributes/te_nsrlgs/__init__.py | 118 +++ .../te_link_attributes/te_srlgs/__init__.py | 115 +++ .../te_link_attributes/underlay/__init__.py | 326 ++++++ .../underlay/backup_path/__init__.py | 207 ++++ .../backup_path/path_element/__init__.py | 321 ++++++ .../path_element/as_number_hop/__init__.py | 154 +++ .../path_element/label_hop/__init__.py | 118 +++ .../label_hop/te_label/__init__.py | 234 +++++ .../label_hop/te_label/otn/__init__.py | 209 ++++ .../numbered_link_hop/__init__.py | 193 ++++ .../numbered_node_hop/__init__.py | 154 +++ .../unnumbered_link_hop/__init__.py | 236 +++++ .../underlay/primary_path/__init__.py | 158 +++ .../primary_path/path_element/__init__.py | 320 ++++++ .../path_element/as_number_hop/__init__.py | 154 +++ .../path_element/label_hop/__init__.py | 118 +++ .../label_hop/te_label/__init__.py | 234 +++++ .../label_hop/te_label/otn/__init__.py | 209 ++++ .../numbered_link_hop/__init__.py | 193 ++++ .../numbered_node_hop/__init__.py | 154 +++ .../unnumbered_link_hop/__init__.py | 236 +++++ .../tunnel_termination_points/__init__.py | 154 +++ .../underlay/tunnels/__init__.py | 167 ++++ .../underlay/tunnels/tunnel/__init__.py | 170 ++++ .../unreserved_bandwidth/__init__.py | 163 +++ .../te_bandwidth/__init__.py | 195 ++++ .../te_bandwidth/otn/__init__.py | 116 +++ .../te_bandwidth/otn/odulist/__init__.py | 200 ++++ .../network/link/te/underlay/__init__.py | 154 +++ .../network/network_types/__init__.py | 118 +++ .../network_types/te_topology/__init__.py | 36 + .../networks/network/node/__init__.py | 291 ++++++ .../network/node/supporting_node/__init__.py | 168 ++++ .../networks/network/node/te/__init__.py | 519 ++++++++++ .../network/node/te/geolocation/__init__.py | 193 ++++ .../te/information_source_entry/__init__.py | 451 +++++++++ .../connectivity_matrices/__init__.py | 412 ++++++++ .../connectivity_matrix/__init__.py | 405 ++++++++ .../connectivity_matrix/from_/__init__.py | 155 +++ .../from_/label_restrictions/__init__.py | 120 +++ .../label_restriction/__init__.py | 450 +++++++++ .../ethernet_label_range/__init__.py | 154 +++ .../label_restriction/label_end/__init__.py | 119 +++ .../label_end/te_label/__init__.py | 234 +++++ .../label_end/te_label/otn/__init__.py | 154 +++ .../label_restriction/label_start/__init__.py | 120 +++ .../label_start/te_label/__init__.py | 234 +++++ .../label_start/te_label/otn/__init__.py | 154 +++ .../label_restriction/label_step/__init__.py | 200 ++++ .../label_step/otn/__init__.py | 158 +++ .../otn_label_range/__init__.py | 256 +++++ .../optimizations/__init__.py | 199 ++++ .../objective_function/__init__.py | 116 +++ .../optimization_metric/__init__.py | 241 +++++ .../__init__.py | 118 +++ .../route_object_exclude_object/__init__.py | 365 +++++++ .../as_number_hop/__init__.py | 154 +++ .../label_hop/__init__.py | 118 +++ .../label_hop/te_label/__init__.py | 234 +++++ .../label_hop/te_label/otn/__init__.py | 209 ++++ .../numbered_link_hop/__init__.py | 193 ++++ .../numbered_node_hop/__init__.py | 154 +++ .../srlg/__init__.py | 115 +++ .../unnumbered_link_hop/__init__.py | 236 +++++ .../__init__.py | 118 +++ .../route_object_include_object/__init__.py | 325 ++++++ .../as_number_hop/__init__.py | 154 +++ .../label_hop/__init__.py | 118 +++ .../label_hop/te_label/__init__.py | 234 +++++ .../label_hop/te_label/otn/__init__.py | 209 ++++ .../numbered_link_hop/__init__.py | 193 ++++ .../numbered_node_hop/__init__.py | 154 +++ .../unnumbered_link_hop/__init__.py | 236 +++++ .../optimizations/tiebreakers/__init__.py | 120 +++ .../tiebreakers/tiebreaker/__init__.py | 122 +++ .../path_constraints/__init__.py | 523 ++++++++++ .../path_affinities_values/__init__.py | 116 +++ .../path_affinities_value/__init__.py | 161 +++ .../path_affinity_names/__init__.py | 116 +++ .../path_affinity_name/__init__.py | 162 +++ .../affinity_name/__init__.py | 120 +++ .../path_metric_bounds/__init__.py | 116 +++ .../path_metric_bound/__init__.py | 165 +++ .../path_srlgs_lists/__init__.py | 116 +++ .../path_srlgs_list/__init__.py | 161 +++ .../path_srlgs_names/__init__.py | 116 +++ .../path_srlgs_name/__init__.py | 161 +++ .../path_constraints/te_bandwidth/__init__.py | 195 ++++ .../te_bandwidth/otn/__init__.py | 163 +++ .../te_bandwidth/otn/odulist/__init__.py | 200 ++++ .../path_properties/__init__.py | 318 ++++++ .../path_affinities_values/__init__.py | 116 +++ .../path_affinities_value/__init__.py | 161 +++ .../path_affinity_names/__init__.py | 116 +++ .../path_affinity_name/__init__.py | 162 +++ .../affinity_name/__init__.py | 120 +++ .../path_properties/path_metric/__init__.py | 159 +++ .../path_route_objects/__init__.py | 119 +++ .../path_route_object/__init__.py | 327 ++++++ .../as_number_hop/__init__.py | 154 +++ .../path_route_object/label_hop/__init__.py | 118 +++ .../label_hop/te_label/__init__.py | 234 +++++ .../label_hop/te_label/otn/__init__.py | 209 ++++ .../numbered_link_hop/__init__.py | 193 ++++ .../numbered_node_hop/__init__.py | 154 +++ .../unnumbered_link_hop/__init__.py | 236 +++++ .../path_srlgs_lists/__init__.py | 116 +++ .../path_srlgs_list/__init__.py | 161 +++ .../path_srlgs_names/__init__.py | 116 +++ .../path_srlgs_name/__init__.py | 161 +++ .../connectivity_matrix/to/__init__.py | 155 +++ .../to/label_restrictions/__init__.py | 120 +++ .../label_restriction/__init__.py | 450 +++++++++ .../ethernet_label_range/__init__.py | 154 +++ .../label_restriction/label_end/__init__.py | 119 +++ .../label_end/te_label/__init__.py | 234 +++++ .../label_end/te_label/otn/__init__.py | 154 +++ .../label_restriction/label_start/__init__.py | 120 +++ .../label_start/te_label/__init__.py | 234 +++++ .../label_start/te_label/otn/__init__.py | 154 +++ .../label_restriction/label_step/__init__.py | 200 ++++ .../label_step/otn/__init__.py | 158 +++ .../otn_label_range/__init__.py | 256 +++++ .../connectivity_matrix/underlay/__init__.py | 326 ++++++ .../underlay/backup_path/__init__.py | 207 ++++ .../backup_path/path_element/__init__.py | 321 ++++++ .../path_element/as_number_hop/__init__.py | 154 +++ .../path_element/label_hop/__init__.py | 118 +++ .../label_hop/te_label/__init__.py | 234 +++++ .../label_hop/te_label/otn/__init__.py | 209 ++++ .../numbered_link_hop/__init__.py | 193 ++++ .../numbered_node_hop/__init__.py | 154 +++ .../unnumbered_link_hop/__init__.py | 236 +++++ .../underlay/primary_path/__init__.py | 158 +++ .../primary_path/path_element/__init__.py | 320 ++++++ .../path_element/as_number_hop/__init__.py | 154 +++ .../path_element/label_hop/__init__.py | 118 +++ .../label_hop/te_label/__init__.py | 234 +++++ .../label_hop/te_label/otn/__init__.py | 209 ++++ .../numbered_link_hop/__init__.py | 193 ++++ .../numbered_node_hop/__init__.py | 154 +++ .../unnumbered_link_hop/__init__.py | 236 +++++ .../tunnel_termination_points/__init__.py | 154 +++ .../underlay/tunnels/__init__.py | 167 ++++ .../underlay/tunnels/tunnel/__init__.py | 170 ++++ .../label_restrictions/__init__.py | 120 +++ .../label_restriction/__init__.py | 450 +++++++++ .../ethernet_label_range/__init__.py | 154 +++ .../label_restriction/label_end/__init__.py | 119 +++ .../label_end/te_label/__init__.py | 234 +++++ .../label_end/te_label/otn/__init__.py | 154 +++ .../label_restriction/label_start/__init__.py | 120 +++ .../label_start/te_label/__init__.py | 234 +++++ .../label_start/te_label/otn/__init__.py | 154 +++ .../label_restriction/label_step/__init__.py | 200 ++++ .../label_step/otn/__init__.py | 158 +++ .../otn_label_range/__init__.py | 256 +++++ .../optimizations/__init__.py | 199 ++++ .../objective_function/__init__.py | 116 +++ .../optimization_metric/__init__.py | 241 +++++ .../__init__.py | 118 +++ .../route_object_exclude_object/__init__.py | 365 +++++++ .../as_number_hop/__init__.py | 154 +++ .../label_hop/__init__.py | 118 +++ .../label_hop/te_label/__init__.py | 234 +++++ .../label_hop/te_label/otn/__init__.py | 209 ++++ .../numbered_link_hop/__init__.py | 193 ++++ .../numbered_node_hop/__init__.py | 154 +++ .../srlg/__init__.py | 115 +++ .../unnumbered_link_hop/__init__.py | 236 +++++ .../__init__.py | 118 +++ .../route_object_include_object/__init__.py | 325 ++++++ .../as_number_hop/__init__.py | 154 +++ .../label_hop/__init__.py | 118 +++ .../label_hop/te_label/__init__.py | 234 +++++ .../label_hop/te_label/otn/__init__.py | 209 ++++ .../numbered_link_hop/__init__.py | 193 ++++ .../numbered_node_hop/__init__.py | 154 +++ .../unnumbered_link_hop/__init__.py | 236 +++++ .../optimizations/tiebreakers/__init__.py | 120 +++ .../tiebreakers/tiebreaker/__init__.py | 122 +++ .../path_constraints/__init__.py | 523 ++++++++++ .../path_affinities_values/__init__.py | 116 +++ .../path_affinities_value/__init__.py | 161 +++ .../path_affinity_names/__init__.py | 116 +++ .../path_affinity_name/__init__.py | 162 +++ .../affinity_name/__init__.py | 120 +++ .../path_metric_bounds/__init__.py | 116 +++ .../path_metric_bound/__init__.py | 165 +++ .../path_srlgs_lists/__init__.py | 116 +++ .../path_srlgs_list/__init__.py | 161 +++ .../path_srlgs_names/__init__.py | 116 +++ .../path_srlgs_name/__init__.py | 161 +++ .../path_constraints/te_bandwidth/__init__.py | 195 ++++ .../te_bandwidth/otn/__init__.py | 163 +++ .../te_bandwidth/otn/odulist/__init__.py | 200 ++++ .../path_properties/__init__.py | 318 ++++++ .../path_affinities_values/__init__.py | 116 +++ .../path_affinities_value/__init__.py | 161 +++ .../path_affinity_names/__init__.py | 116 +++ .../path_affinity_name/__init__.py | 162 +++ .../affinity_name/__init__.py | 120 +++ .../path_properties/path_metric/__init__.py | 159 +++ .../path_route_objects/__init__.py | 119 +++ .../path_route_object/__init__.py | 327 ++++++ .../as_number_hop/__init__.py | 154 +++ .../path_route_object/label_hop/__init__.py | 118 +++ .../label_hop/te_label/__init__.py | 234 +++++ .../label_hop/te_label/otn/__init__.py | 209 ++++ .../numbered_link_hop/__init__.py | 193 ++++ .../numbered_node_hop/__init__.py | 154 +++ .../unnumbered_link_hop/__init__.py | 236 +++++ .../path_srlgs_lists/__init__.py | 116 +++ .../path_srlgs_list/__init__.py | 161 +++ .../path_srlgs_names/__init__.py | 116 +++ .../path_srlgs_name/__init__.py | 161 +++ .../underlay/__init__.py | 326 ++++++ .../underlay/backup_path/__init__.py | 207 ++++ .../backup_path/path_element/__init__.py | 321 ++++++ .../path_element/as_number_hop/__init__.py | 154 +++ .../path_element/label_hop/__init__.py | 118 +++ .../label_hop/te_label/__init__.py | 234 +++++ .../label_hop/te_label/otn/__init__.py | 209 ++++ .../numbered_link_hop/__init__.py | 193 ++++ .../numbered_node_hop/__init__.py | 154 +++ .../unnumbered_link_hop/__init__.py | 236 +++++ .../underlay/primary_path/__init__.py | 158 +++ .../primary_path/path_element/__init__.py | 320 ++++++ .../path_element/as_number_hop/__init__.py | 154 +++ .../path_element/label_hop/__init__.py | 118 +++ .../label_hop/te_label/__init__.py | 234 +++++ .../label_hop/te_label/otn/__init__.py | 209 ++++ .../numbered_link_hop/__init__.py | 193 ++++ .../numbered_node_hop/__init__.py | 154 +++ .../unnumbered_link_hop/__init__.py | 236 +++++ .../tunnel_termination_points/__init__.py | 154 +++ .../underlay/tunnels/__init__.py | 167 ++++ .../underlay/tunnels/tunnel/__init__.py | 170 ++++ .../information_source_state/__init__.py | 248 +++++ .../topology/__init__.py | 162 +++ .../underlay_topology/__init__.py | 118 +++ .../te/information_source_state/__init__.py | 248 +++++ .../topology/__init__.py | 162 +++ .../network/node/te/statistics/__init__.py | 207 ++++ .../connectivity_matrix_entry/__init__.py | 282 ++++++ .../node/te/statistics/node/__init__.py | 273 +++++ .../node/te/te_node_attributes/__init__.py | 357 +++++++ .../connectivity_matrices/__init__.py | 412 ++++++++ .../connectivity_matrix/__init__.py | 405 ++++++++ .../connectivity_matrix/from_/__init__.py | 155 +++ .../from_/label_restrictions/__init__.py | 120 +++ .../label_restriction/__init__.py | 450 +++++++++ .../ethernet_label_range/__init__.py | 154 +++ .../label_restriction/label_end/__init__.py | 119 +++ .../label_end/te_label/__init__.py | 234 +++++ .../label_end/te_label/otn/__init__.py | 154 +++ .../label_restriction/label_start/__init__.py | 120 +++ .../label_start/te_label/__init__.py | 234 +++++ .../label_start/te_label/otn/__init__.py | 154 +++ .../label_restriction/label_step/__init__.py | 200 ++++ .../label_step/otn/__init__.py | 158 +++ .../otn_label_range/__init__.py | 256 +++++ .../optimizations/__init__.py | 199 ++++ .../objective_function/__init__.py | 116 +++ .../optimization_metric/__init__.py | 241 +++++ .../__init__.py | 118 +++ .../route_object_exclude_object/__init__.py | 365 +++++++ .../as_number_hop/__init__.py | 154 +++ .../label_hop/__init__.py | 118 +++ .../label_hop/te_label/__init__.py | 234 +++++ .../label_hop/te_label/otn/__init__.py | 209 ++++ .../numbered_link_hop/__init__.py | 193 ++++ .../numbered_node_hop/__init__.py | 154 +++ .../srlg/__init__.py | 115 +++ .../unnumbered_link_hop/__init__.py | 236 +++++ .../__init__.py | 118 +++ .../route_object_include_object/__init__.py | 325 ++++++ .../as_number_hop/__init__.py | 154 +++ .../label_hop/__init__.py | 118 +++ .../label_hop/te_label/__init__.py | 234 +++++ .../label_hop/te_label/otn/__init__.py | 209 ++++ .../numbered_link_hop/__init__.py | 193 ++++ .../numbered_node_hop/__init__.py | 154 +++ .../unnumbered_link_hop/__init__.py | 236 +++++ .../optimizations/tiebreakers/__init__.py | 120 +++ .../tiebreakers/tiebreaker/__init__.py | 122 +++ .../path_constraints/__init__.py | 523 ++++++++++ .../path_affinities_values/__init__.py | 116 +++ .../path_affinities_value/__init__.py | 161 +++ .../path_affinity_names/__init__.py | 116 +++ .../path_affinity_name/__init__.py | 162 +++ .../affinity_name/__init__.py | 120 +++ .../path_metric_bounds/__init__.py | 116 +++ .../path_metric_bound/__init__.py | 165 +++ .../path_srlgs_lists/__init__.py | 116 +++ .../path_srlgs_list/__init__.py | 161 +++ .../path_srlgs_names/__init__.py | 116 +++ .../path_srlgs_name/__init__.py | 161 +++ .../path_constraints/te_bandwidth/__init__.py | 195 ++++ .../te_bandwidth/otn/__init__.py | 163 +++ .../te_bandwidth/otn/odulist/__init__.py | 200 ++++ .../path_properties/__init__.py | 318 ++++++ .../path_affinities_values/__init__.py | 116 +++ .../path_affinities_value/__init__.py | 161 +++ .../path_affinity_names/__init__.py | 116 +++ .../path_affinity_name/__init__.py | 162 +++ .../affinity_name/__init__.py | 120 +++ .../path_properties/path_metric/__init__.py | 159 +++ .../path_route_objects/__init__.py | 119 +++ .../path_route_object/__init__.py | 327 ++++++ .../as_number_hop/__init__.py | 154 +++ .../path_route_object/label_hop/__init__.py | 118 +++ .../label_hop/te_label/__init__.py | 234 +++++ .../label_hop/te_label/otn/__init__.py | 209 ++++ .../numbered_link_hop/__init__.py | 193 ++++ .../numbered_node_hop/__init__.py | 154 +++ .../unnumbered_link_hop/__init__.py | 236 +++++ .../path_srlgs_lists/__init__.py | 116 +++ .../path_srlgs_list/__init__.py | 161 +++ .../path_srlgs_names/__init__.py | 116 +++ .../path_srlgs_name/__init__.py | 161 +++ .../connectivity_matrix/to/__init__.py | 155 +++ .../to/label_restrictions/__init__.py | 120 +++ .../label_restriction/__init__.py | 450 +++++++++ .../ethernet_label_range/__init__.py | 154 +++ .../label_restriction/label_end/__init__.py | 119 +++ .../label_end/te_label/__init__.py | 234 +++++ .../label_end/te_label/otn/__init__.py | 154 +++ .../label_restriction/label_start/__init__.py | 120 +++ .../label_start/te_label/__init__.py | 234 +++++ .../label_start/te_label/otn/__init__.py | 154 +++ .../label_restriction/label_step/__init__.py | 200 ++++ .../label_step/otn/__init__.py | 158 +++ .../otn_label_range/__init__.py | 256 +++++ .../connectivity_matrix/underlay/__init__.py | 326 ++++++ .../underlay/backup_path/__init__.py | 207 ++++ .../backup_path/path_element/__init__.py | 321 ++++++ .../path_element/as_number_hop/__init__.py | 154 +++ .../path_element/label_hop/__init__.py | 118 +++ .../label_hop/te_label/__init__.py | 234 +++++ .../label_hop/te_label/otn/__init__.py | 209 ++++ .../numbered_link_hop/__init__.py | 193 ++++ .../numbered_node_hop/__init__.py | 154 +++ .../unnumbered_link_hop/__init__.py | 236 +++++ .../underlay/primary_path/__init__.py | 158 +++ .../primary_path/path_element/__init__.py | 320 ++++++ .../path_element/as_number_hop/__init__.py | 154 +++ .../path_element/label_hop/__init__.py | 118 +++ .../label_hop/te_label/__init__.py | 234 +++++ .../label_hop/te_label/otn/__init__.py | 209 ++++ .../numbered_link_hop/__init__.py | 193 ++++ .../numbered_node_hop/__init__.py | 154 +++ .../unnumbered_link_hop/__init__.py | 236 +++++ .../tunnel_termination_points/__init__.py | 154 +++ .../underlay/tunnels/__init__.py | 167 ++++ .../underlay/tunnels/tunnel/__init__.py | 170 ++++ .../label_restrictions/__init__.py | 120 +++ .../label_restriction/__init__.py | 450 +++++++++ .../ethernet_label_range/__init__.py | 154 +++ .../label_restriction/label_end/__init__.py | 119 +++ .../label_end/te_label/__init__.py | 234 +++++ .../label_end/te_label/otn/__init__.py | 154 +++ .../label_restriction/label_start/__init__.py | 120 +++ .../label_start/te_label/__init__.py | 234 +++++ .../label_start/te_label/otn/__init__.py | 154 +++ .../label_restriction/label_step/__init__.py | 200 ++++ .../label_step/otn/__init__.py | 158 +++ .../otn_label_range/__init__.py | 256 +++++ .../optimizations/__init__.py | 199 ++++ .../objective_function/__init__.py | 116 +++ .../optimization_metric/__init__.py | 241 +++++ .../__init__.py | 118 +++ .../route_object_exclude_object/__init__.py | 365 +++++++ .../as_number_hop/__init__.py | 154 +++ .../label_hop/__init__.py | 118 +++ .../label_hop/te_label/__init__.py | 234 +++++ .../label_hop/te_label/otn/__init__.py | 209 ++++ .../numbered_link_hop/__init__.py | 193 ++++ .../numbered_node_hop/__init__.py | 154 +++ .../srlg/__init__.py | 115 +++ .../unnumbered_link_hop/__init__.py | 236 +++++ .../__init__.py | 118 +++ .../route_object_include_object/__init__.py | 325 ++++++ .../as_number_hop/__init__.py | 154 +++ .../label_hop/__init__.py | 118 +++ .../label_hop/te_label/__init__.py | 234 +++++ .../label_hop/te_label/otn/__init__.py | 209 ++++ .../numbered_link_hop/__init__.py | 193 ++++ .../numbered_node_hop/__init__.py | 154 +++ .../unnumbered_link_hop/__init__.py | 236 +++++ .../optimizations/tiebreakers/__init__.py | 120 +++ .../tiebreakers/tiebreaker/__init__.py | 122 +++ .../path_constraints/__init__.py | 523 ++++++++++ .../path_affinities_values/__init__.py | 116 +++ .../path_affinities_value/__init__.py | 161 +++ .../path_affinity_names/__init__.py | 116 +++ .../path_affinity_name/__init__.py | 162 +++ .../affinity_name/__init__.py | 120 +++ .../path_metric_bounds/__init__.py | 116 +++ .../path_metric_bound/__init__.py | 165 +++ .../path_srlgs_lists/__init__.py | 116 +++ .../path_srlgs_list/__init__.py | 161 +++ .../path_srlgs_names/__init__.py | 116 +++ .../path_srlgs_name/__init__.py | 161 +++ .../path_constraints/te_bandwidth/__init__.py | 195 ++++ .../te_bandwidth/otn/__init__.py | 163 +++ .../te_bandwidth/otn/odulist/__init__.py | 200 ++++ .../path_properties/__init__.py | 318 ++++++ .../path_affinities_values/__init__.py | 116 +++ .../path_affinities_value/__init__.py | 161 +++ .../path_affinity_names/__init__.py | 116 +++ .../path_affinity_name/__init__.py | 162 +++ .../affinity_name/__init__.py | 120 +++ .../path_properties/path_metric/__init__.py | 159 +++ .../path_route_objects/__init__.py | 119 +++ .../path_route_object/__init__.py | 327 ++++++ .../as_number_hop/__init__.py | 154 +++ .../path_route_object/label_hop/__init__.py | 118 +++ .../label_hop/te_label/__init__.py | 234 +++++ .../label_hop/te_label/otn/__init__.py | 209 ++++ .../numbered_link_hop/__init__.py | 193 ++++ .../numbered_node_hop/__init__.py | 154 +++ .../unnumbered_link_hop/__init__.py | 236 +++++ .../path_srlgs_lists/__init__.py | 116 +++ .../path_srlgs_list/__init__.py | 161 +++ .../path_srlgs_names/__init__.py | 116 +++ .../path_srlgs_name/__init__.py | 161 +++ .../underlay/__init__.py | 326 ++++++ .../underlay/backup_path/__init__.py | 207 ++++ .../backup_path/path_element/__init__.py | 321 ++++++ .../path_element/as_number_hop/__init__.py | 154 +++ .../path_element/label_hop/__init__.py | 118 +++ .../label_hop/te_label/__init__.py | 234 +++++ .../label_hop/te_label/otn/__init__.py | 209 ++++ .../numbered_link_hop/__init__.py | 193 ++++ .../numbered_node_hop/__init__.py | 154 +++ .../unnumbered_link_hop/__init__.py | 236 +++++ .../underlay/primary_path/__init__.py | 158 +++ .../primary_path/path_element/__init__.py | 320 ++++++ .../path_element/as_number_hop/__init__.py | 154 +++ .../path_element/label_hop/__init__.py | 118 +++ .../label_hop/te_label/__init__.py | 234 +++++ .../label_hop/te_label/otn/__init__.py | 209 ++++ .../numbered_link_hop/__init__.py | 193 ++++ .../numbered_node_hop/__init__.py | 154 +++ .../unnumbered_link_hop/__init__.py | 236 +++++ .../tunnel_termination_points/__init__.py | 154 +++ .../underlay/tunnels/__init__.py | 167 ++++ .../underlay/tunnels/tunnel/__init__.py | 170 ++++ .../underlay_topology/__init__.py | 118 +++ .../te/tunnel_termination_point/__init__.py | 597 +++++++++++ .../client_layer_adaptation/__init__.py | 117 +++ .../switching_capability/__init__.py | 206 ++++ .../te_bandwidth/__init__.py | 195 ++++ .../te_bandwidth/otn/__init__.py | 163 +++ .../te_bandwidth/otn/odulist/__init__.py | 200 ++++ .../geolocation/__init__.py | 193 ++++ .../local_link_connectivities/__init__.py | 418 ++++++++ .../label_restrictions/__init__.py | 120 +++ .../label_restriction/__init__.py | 450 +++++++++ .../ethernet_label_range/__init__.py | 154 +++ .../label_restriction/label_end/__init__.py | 119 +++ .../label_end/te_label/__init__.py | 234 +++++ .../label_end/te_label/otn/__init__.py | 154 +++ .../label_restriction/label_start/__init__.py | 120 +++ .../label_start/te_label/__init__.py | 234 +++++ .../label_start/te_label/otn/__init__.py | 154 +++ .../label_restriction/label_step/__init__.py | 200 ++++ .../label_step/otn/__init__.py | 158 +++ .../otn_label_range/__init__.py | 256 +++++ .../local_link_connectivity/__init__.py | 368 +++++++ .../label_restrictions/__init__.py | 120 +++ .../label_restriction/__init__.py | 450 +++++++++ .../ethernet_label_range/__init__.py | 154 +++ .../label_restriction/label_end/__init__.py | 119 +++ .../label_end/te_label/__init__.py | 234 +++++ .../label_end/te_label/otn/__init__.py | 154 +++ .../label_restriction/label_start/__init__.py | 120 +++ .../label_start/te_label/__init__.py | 234 +++++ .../label_start/te_label/otn/__init__.py | 154 +++ .../label_restriction/label_step/__init__.py | 200 ++++ .../label_step/otn/__init__.py | 158 +++ .../otn_label_range/__init__.py | 256 +++++ .../optimizations/__init__.py | 199 ++++ .../objective_function/__init__.py | 116 +++ .../optimization_metric/__init__.py | 241 +++++ .../__init__.py | 118 +++ .../route_object_exclude_object/__init__.py | 365 +++++++ .../as_number_hop/__init__.py | 154 +++ .../label_hop/__init__.py | 118 +++ .../label_hop/te_label/__init__.py | 234 +++++ .../label_hop/te_label/otn/__init__.py | 209 ++++ .../numbered_link_hop/__init__.py | 193 ++++ .../numbered_node_hop/__init__.py | 154 +++ .../srlg/__init__.py | 115 +++ .../unnumbered_link_hop/__init__.py | 236 +++++ .../__init__.py | 118 +++ .../route_object_include_object/__init__.py | 325 ++++++ .../as_number_hop/__init__.py | 154 +++ .../label_hop/__init__.py | 118 +++ .../label_hop/te_label/__init__.py | 234 +++++ .../label_hop/te_label/otn/__init__.py | 209 ++++ .../numbered_link_hop/__init__.py | 193 ++++ .../numbered_node_hop/__init__.py | 154 +++ .../unnumbered_link_hop/__init__.py | 236 +++++ .../optimizations/tiebreakers/__init__.py | 120 +++ .../tiebreakers/tiebreaker/__init__.py | 122 +++ .../path_constraints/__init__.py | 523 ++++++++++ .../path_affinities_values/__init__.py | 116 +++ .../path_affinities_value/__init__.py | 161 +++ .../path_affinity_names/__init__.py | 116 +++ .../path_affinity_name/__init__.py | 162 +++ .../affinity_name/__init__.py | 120 +++ .../path_metric_bounds/__init__.py | 116 +++ .../path_metric_bound/__init__.py | 165 +++ .../path_srlgs_lists/__init__.py | 116 +++ .../path_srlgs_list/__init__.py | 161 +++ .../path_srlgs_names/__init__.py | 116 +++ .../path_srlgs_name/__init__.py | 161 +++ .../path_constraints/te_bandwidth/__init__.py | 195 ++++ .../te_bandwidth/otn/__init__.py | 163 +++ .../te_bandwidth/otn/odulist/__init__.py | 200 ++++ .../path_properties/__init__.py | 318 ++++++ .../path_affinities_values/__init__.py | 116 +++ .../path_affinities_value/__init__.py | 161 +++ .../path_affinity_names/__init__.py | 116 +++ .../path_affinity_name/__init__.py | 162 +++ .../affinity_name/__init__.py | 120 +++ .../path_properties/path_metric/__init__.py | 159 +++ .../path_route_objects/__init__.py | 119 +++ .../path_route_object/__init__.py | 327 ++++++ .../as_number_hop/__init__.py | 154 +++ .../path_route_object/label_hop/__init__.py | 118 +++ .../label_hop/te_label/__init__.py | 234 +++++ .../label_hop/te_label/otn/__init__.py | 209 ++++ .../numbered_link_hop/__init__.py | 193 ++++ .../numbered_node_hop/__init__.py | 154 +++ .../unnumbered_link_hop/__init__.py | 236 +++++ .../path_srlgs_lists/__init__.py | 116 +++ .../path_srlgs_list/__init__.py | 161 +++ .../path_srlgs_names/__init__.py | 116 +++ .../path_srlgs_name/__init__.py | 161 +++ .../underlay/__init__.py | 326 ++++++ .../underlay/backup_path/__init__.py | 207 ++++ .../backup_path/path_element/__init__.py | 321 ++++++ .../path_element/as_number_hop/__init__.py | 154 +++ .../path_element/label_hop/__init__.py | 118 +++ .../label_hop/te_label/__init__.py | 234 +++++ .../label_hop/te_label/otn/__init__.py | 209 ++++ .../numbered_link_hop/__init__.py | 193 ++++ .../numbered_node_hop/__init__.py | 154 +++ .../unnumbered_link_hop/__init__.py | 236 +++++ .../underlay/primary_path/__init__.py | 158 +++ .../primary_path/path_element/__init__.py | 320 ++++++ .../path_element/as_number_hop/__init__.py | 154 +++ .../path_element/label_hop/__init__.py | 118 +++ .../label_hop/te_label/__init__.py | 234 +++++ .../label_hop/te_label/otn/__init__.py | 209 ++++ .../numbered_link_hop/__init__.py | 193 ++++ .../numbered_node_hop/__init__.py | 154 +++ .../unnumbered_link_hop/__init__.py | 236 +++++ .../tunnel_termination_points/__init__.py | 154 +++ .../underlay/tunnels/__init__.py | 167 ++++ .../underlay/tunnels/tunnel/__init__.py | 170 ++++ .../optimizations/__init__.py | 199 ++++ .../objective_function/__init__.py | 116 +++ .../optimization_metric/__init__.py | 241 +++++ .../__init__.py | 118 +++ .../route_object_exclude_object/__init__.py | 365 +++++++ .../as_number_hop/__init__.py | 154 +++ .../label_hop/__init__.py | 118 +++ .../label_hop/te_label/__init__.py | 234 +++++ .../label_hop/te_label/otn/__init__.py | 209 ++++ .../numbered_link_hop/__init__.py | 193 ++++ .../numbered_node_hop/__init__.py | 154 +++ .../srlg/__init__.py | 115 +++ .../unnumbered_link_hop/__init__.py | 236 +++++ .../__init__.py | 118 +++ .../route_object_include_object/__init__.py | 325 ++++++ .../as_number_hop/__init__.py | 154 +++ .../label_hop/__init__.py | 118 +++ .../label_hop/te_label/__init__.py | 234 +++++ .../label_hop/te_label/otn/__init__.py | 209 ++++ .../numbered_link_hop/__init__.py | 193 ++++ .../numbered_node_hop/__init__.py | 154 +++ .../unnumbered_link_hop/__init__.py | 236 +++++ .../optimizations/tiebreakers/__init__.py | 120 +++ .../tiebreakers/tiebreaker/__init__.py | 122 +++ .../path_constraints/__init__.py | 523 ++++++++++ .../path_affinities_values/__init__.py | 116 +++ .../path_affinities_value/__init__.py | 161 +++ .../path_affinity_names/__init__.py | 116 +++ .../path_affinity_name/__init__.py | 162 +++ .../affinity_name/__init__.py | 120 +++ .../path_metric_bounds/__init__.py | 116 +++ .../path_metric_bound/__init__.py | 165 +++ .../path_srlgs_lists/__init__.py | 116 +++ .../path_srlgs_list/__init__.py | 161 +++ .../path_srlgs_names/__init__.py | 116 +++ .../path_srlgs_name/__init__.py | 161 +++ .../path_constraints/te_bandwidth/__init__.py | 195 ++++ .../te_bandwidth/otn/__init__.py | 163 +++ .../te_bandwidth/otn/odulist/__init__.py | 200 ++++ .../path_properties/__init__.py | 318 ++++++ .../path_affinities_values/__init__.py | 116 +++ .../path_affinities_value/__init__.py | 161 +++ .../path_affinity_names/__init__.py | 116 +++ .../path_affinity_name/__init__.py | 162 +++ .../affinity_name/__init__.py | 120 +++ .../path_properties/path_metric/__init__.py | 159 +++ .../path_route_objects/__init__.py | 119 +++ .../path_route_object/__init__.py | 327 ++++++ .../as_number_hop/__init__.py | 154 +++ .../path_route_object/label_hop/__init__.py | 118 +++ .../label_hop/te_label/__init__.py | 234 +++++ .../label_hop/te_label/otn/__init__.py | 209 ++++ .../numbered_link_hop/__init__.py | 193 ++++ .../numbered_node_hop/__init__.py | 154 +++ .../unnumbered_link_hop/__init__.py | 236 +++++ .../path_srlgs_lists/__init__.py | 116 +++ .../path_srlgs_list/__init__.py | 161 +++ .../path_srlgs_names/__init__.py | 116 +++ .../path_srlgs_name/__init__.py | 161 +++ .../underlay/__init__.py | 326 ++++++ .../underlay/backup_path/__init__.py | 207 ++++ .../backup_path/path_element/__init__.py | 321 ++++++ .../path_element/as_number_hop/__init__.py | 154 +++ .../path_element/label_hop/__init__.py | 118 +++ .../label_hop/te_label/__init__.py | 234 +++++ .../label_hop/te_label/otn/__init__.py | 209 ++++ .../numbered_link_hop/__init__.py | 193 ++++ .../numbered_node_hop/__init__.py | 154 +++ .../unnumbered_link_hop/__init__.py | 236 +++++ .../underlay/primary_path/__init__.py | 158 +++ .../primary_path/path_element/__init__.py | 320 ++++++ .../path_element/as_number_hop/__init__.py | 154 +++ .../path_element/label_hop/__init__.py | 118 +++ .../label_hop/te_label/__init__.py | 234 +++++ .../label_hop/te_label/otn/__init__.py | 209 ++++ .../numbered_link_hop/__init__.py | 193 ++++ .../numbered_node_hop/__init__.py | 154 +++ .../unnumbered_link_hop/__init__.py | 236 +++++ .../tunnel_termination_points/__init__.py | 154 +++ .../underlay/tunnels/__init__.py | 167 ++++ .../underlay/tunnels/tunnel/__init__.py | 170 ++++ .../statistics/__init__.py | 207 ++++ .../local_link_connectivity/__init__.py | 272 +++++ .../tunnel_termination_point/__init__.py | 435 ++++++++ .../__init__.py | 172 ++++ .../node/termination_point/__init__.py | 339 +++++++ .../termination_point/eth_link_tp/__init__.py | 315 ++++++ .../egress_bandwidth_profile/__init__.py | 355 +++++++ .../ingress_bandwidth_profile/__init__.py | 355 +++++++ .../__init__.py | 356 +++++++ .../termination_point/eth_svc/__init__.py | 158 +++ .../supported_classification/__init__.py | 160 +++ .../vlan_classification/__init__.py | 202 ++++ .../vlan_classification/outer_tag/__init__.py | 202 ++++ .../second_tag/__init__.py | 243 +++++ .../supported_vlan_operations/__init__.py | 240 +++++ .../vlan_pop/__init__.py | 158 +++ .../vlan_push/__init__.py | 201 ++++ .../vlan_push/outer_tag/__init__.py | 161 +++ .../vlan_push/second_tag/__init__.py | 202 ++++ .../supporting_termination_point/__init__.py | 222 +++++ .../node/termination_point/te/__init__.py | 445 +++++++++ .../te/client_svc/__init__.py | 115 +++ .../te/geolocation/__init__.py | 193 ++++ .../__init__.py | 206 ++++ .../max_lsp_bandwidth/__init__.py | 163 +++ .../te_bandwidth/__init__.py | 195 ++++ .../te_bandwidth/otn/__init__.py | 156 +++ .../termination_point/te/otn_ltp/__init__.py | 121 +++ .../network/supporting_network/__init__.py | 121 +++ .../bindings/networks/network/te/__init__.py | 283 ++++++ .../network/te/geolocation/__init__.py | 193 ++++ .../networks/network/te/nsrlg/__init__.py | 159 +++ .../te_topology_identifier/__init__.py | 205 ++++ .../bindings/networks/te/__init__.py | 118 +++ .../networks/te/templates/__init__.py | 161 +++ .../te/templates/link_template/__init__.py | 251 +++++ .../te_link_attributes/__init__.py | 858 ++++++++++++++++ .../external_domain/__init__.py | 205 ++++ .../__init__.py | 206 ++++ .../max_lsp_bandwidth/__init__.py | 163 +++ .../te_bandwidth/__init__.py | 195 ++++ .../te_bandwidth/otn/__init__.py | 156 +++ .../label_restrictions/__init__.py | 120 +++ .../label_restriction/__init__.py | 450 +++++++++ .../ethernet_label_range/__init__.py | 154 +++ .../label_restriction/label_end/__init__.py | 119 +++ .../label_end/te_label/__init__.py | 234 +++++ .../label_end/te_label/otn/__init__.py | 154 +++ .../label_restriction/label_start/__init__.py | 120 +++ .../label_start/te_label/__init__.py | 234 +++++ .../label_start/te_label/otn/__init__.py | 154 +++ .../label_restriction/label_step/__init__.py | 200 ++++ .../label_step/otn/__init__.py | 158 +++ .../otn_label_range/__init__.py | 256 +++++ .../max_link_bandwidth/__init__.py | 119 +++ .../te_bandwidth/__init__.py | 195 ++++ .../te_bandwidth/otn/__init__.py | 116 +++ .../te_bandwidth/otn/odulist/__init__.py | 200 ++++ .../max_resv_link_bandwidth/__init__.py | 119 +++ .../te_bandwidth/__init__.py | 195 ++++ .../te_bandwidth/otn/__init__.py | 116 +++ .../te_bandwidth/otn/odulist/__init__.py | 200 ++++ .../te_link_attributes/te_nsrlgs/__init__.py | 118 +++ .../te_link_attributes/te_srlgs/__init__.py | 115 +++ .../te_link_attributes/underlay/__init__.py | 326 ++++++ .../underlay/backup_path/__init__.py | 207 ++++ .../backup_path/path_element/__init__.py | 321 ++++++ .../path_element/as_number_hop/__init__.py | 154 +++ .../path_element/label_hop/__init__.py | 118 +++ .../label_hop/te_label/__init__.py | 234 +++++ .../label_hop/te_label/otn/__init__.py | 209 ++++ .../numbered_link_hop/__init__.py | 193 ++++ .../numbered_node_hop/__init__.py | 154 +++ .../unnumbered_link_hop/__init__.py | 236 +++++ .../underlay/primary_path/__init__.py | 158 +++ .../primary_path/path_element/__init__.py | 320 ++++++ .../path_element/as_number_hop/__init__.py | 154 +++ .../path_element/label_hop/__init__.py | 118 +++ .../label_hop/te_label/__init__.py | 234 +++++ .../label_hop/te_label/otn/__init__.py | 209 ++++ .../numbered_link_hop/__init__.py | 193 ++++ .../numbered_node_hop/__init__.py | 154 +++ .../unnumbered_link_hop/__init__.py | 236 +++++ .../tunnel_termination_points/__init__.py | 154 +++ .../underlay/tunnels/__init__.py | 167 ++++ .../underlay/tunnels/tunnel/__init__.py | 170 ++++ .../unreserved_bandwidth/__init__.py | 163 +++ .../te_bandwidth/__init__.py | 195 ++++ .../te_bandwidth/otn/__init__.py | 116 +++ .../te_bandwidth/otn/odulist/__init__.py | 200 ++++ .../te/templates/node_template/__init__.py | 251 +++++ .../te_node_attributes/__init__.py | 317 ++++++ .../underlay_topology/__init__.py | 118 +++ src/nbi/tests/test_ietf_network.py | 6 +- 823 files changed, 158320 insertions(+), 57 deletions(-) rename src/nbi/service/rest_server/nbi_plugins/ietf_network/{TODO.txt => _docs/test_commands.txt} (94%) create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/destination/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/source/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/supporting_link/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/bundled_links/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/bundled_links/bundled_link/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/component_links/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/component_links/component_link/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/information_source_state/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/information_source_state/topology/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/ethernet_label_range/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/otn_label_range/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_link_bandwidth/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/otn/odulist/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_resv_link_bandwidth/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/otn/odulist/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/te_nsrlgs/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/te_srlgs/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/unreserved_bandwidth/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/otn/odulist/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_state/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_state/topology/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/recovery/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/statistics/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/client_svc/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/external_domain/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/ethernet_label_range/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/otn_label_range/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_link_bandwidth/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/otn_link/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/te_nsrlgs/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/te_srlgs/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/as_number_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/numbered_node_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/as_number_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/numbered_node_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/tunnel_termination_points/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/tunnels/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/tunnels/tunnel/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/unreserved_bandwidth/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/underlay/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/network_types/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/network_types/te_topology/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/supporting_node/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/geolocation/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/ethernet_label_range/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_end/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_end/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_start/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_start/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_step/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_step/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/otn_label_range/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/objective_function/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers/tiebreaker/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_metric/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/as_number_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_node_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/ethernet_label_range/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/as_number_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_node_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/as_number_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_node_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnels/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/ethernet_label_range/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/objective_function/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/tiebreakers/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/tiebreakers/tiebreaker/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinities_values/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_metric_bounds/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_lists/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_names/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinities_values/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_metric/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/as_number_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_node_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_lists/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_names/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/as_number_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/numbered_node_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/as_number_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/numbered_node_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnel_termination_points/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnels/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnels/tunnel/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/information_source_state/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/information_source_state/topology/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/underlay_topology/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_state/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_state/topology/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/statistics/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/statistics/connectivity_matrix_entry/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/statistics/node/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/ethernet_label_range/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_end/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_end/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_start/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_start/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_step/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_step/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/otn_label_range/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/objective_function/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers/tiebreaker/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_metric/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/as_number_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_node_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/ethernet_label_range/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/as_number_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_node_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/as_number_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_node_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnels/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/ethernet_label_range/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/objective_function/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/tiebreakers/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/tiebreakers/tiebreaker/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinities_values/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_metric_bounds/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_lists/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_names/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinities_values/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_metric/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/as_number_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_node_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_lists/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_names/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/as_number_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/numbered_node_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/as_number_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/numbered_node_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnel_termination_points/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnels/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnels/tunnel/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/underlay_topology/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/otn/odulist/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/geolocation/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/ethernet_label_range/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/otn_label_range/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/ethernet_label_range/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/otn_label_range/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/objective_function/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/tiebreakers/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/tiebreakers/tiebreaker/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinities_values/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinities_values/path_affinities_value/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/path_affinity_name/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_metric_bounds/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_metric_bounds/path_metric_bound/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_lists/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_names/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/otn/odulist/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinities_values/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinities_values/path_affinities_value/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/path_affinity_name/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_metric/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/as_number_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/numbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/numbered_node_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_lists/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_names/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_names/path_srlgs_name/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/as_number_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/numbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/numbered_node_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/as_number_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/numbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/numbered_node_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnel_termination_points/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnels/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnels/tunnel/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/objective_function/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/tiebreakers/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/tiebreakers/tiebreaker/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinities_values/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinities_values/path_affinities_value/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/path_affinity_name/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_metric_bounds/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_metric_bounds/path_metric_bound/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_lists/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_names/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/otn/odulist/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinities_values/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinities_values/path_affinities_value/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/path_affinity_name/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_metric/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/as_number_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/numbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/numbered_node_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_lists/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_names/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_names/path_srlgs_name/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/as_number_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/numbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/numbered_node_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/as_number_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/numbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/numbered_node_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnel_termination_points/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnels/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnels/tunnel/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/statistics/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/statistics/local_link_connectivity/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/supporting_tunnel_termination_point/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_link_tp/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_link_tp/egress_bandwidth_profile/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_link_tp/ingress_bandwidth_profile/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_link_tp/ingress_egress_bandwidth_profile/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_classification/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/outer_tag/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/second_tag/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_vlan_operations/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_pop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/outer_tag/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/second_tag/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/supporting_termination_point/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/client_svc/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/geolocation/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/interface_switching_capability/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/otn_ltp/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/supporting_network/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/te/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/te/geolocation/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/te/nsrlg/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/te_topology_identifier/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/external_domain/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/ethernet_label_range/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/otn_label_range/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/te_nsrlgs/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/te_srlgs/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/as_number_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/numbered_node_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/as_number_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/numbered_node_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/tunnel_termination_points/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/tunnels/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/tunnels/tunnel/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/node_template/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/node_template/te_node_attributes/__init__.py create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/node_template/te_node_attributes/underlay_topology/__init__.py diff --git a/scripts/run_tests_locally-nbi-ietf-network.sh b/scripts/run_tests_locally-nbi-ietf-network.sh index 7193dd727..a9fa03087 100755 --- a/scripts/run_tests_locally-nbi-ietf-network.sh +++ b/scripts/run_tests_locally-nbi-ietf-network.sh @@ -20,5 +20,6 @@ cd $PROJECTDIR/src RCFILE=$PROJECTDIR/coverage/.coveragerc # Run unitary tests and analyze coverage of code at same time +# helpful pytest flags: --log-level=INFO -o log_cli=true --verbose --maxfail=1 --durations=0 coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ nbi/tests/test_ietf_network.py diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeNetwork.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeNetwork.py index 49fd523ab..6ffc85e38 100644 --- a/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeNetwork.py +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeNetwork.py @@ -13,20 +13,46 @@ # limitations under the License. import logging, re +from common.DeviceTypes import DeviceTypeEnum from common.proto.context_pb2 import TopologyDetails -from nbi.service.rest_server.nbi_plugins.ietf_network.NetworkTypeEnum import NetworkTypeEnum, get_network_topology_type from .bindings.networks.network import network -from .NameMapping import NameMappings -from .ComposeNode import compose_node from .ComposeLink import compose_link +from .ComposeNode import compose_node +from .NameMapping import NameMappings +from .NetworkTypeEnum import NetworkTypeEnum, get_network_topology_type LOGGER = logging.getLogger(__name__) -def compose_network(ietf_network_obj : network, topology_details : TopologyDetails) -> None: - ietf_network_obj.te.name = 'Huawei-Network' +IGNORE_DEVICE_TYPES = { + DeviceTypeEnum.CLIENT.value, + DeviceTypeEnum.DATACENTER.value, + DeviceTypeEnum.EMULATED_CLIENT.value, + DeviceTypeEnum.EMULATED_DATACENTER.value, + DeviceTypeEnum.EMULATED_MICROWAVE_RADIO_SYSTEM.value, + DeviceTypeEnum.EMULATED_OPEN_LINE_SYSTEM.value, + DeviceTypeEnum.EMULATED_XR_CONSTELLATION.value, + DeviceTypeEnum.MICROWAVE_RADIO_SYSTEM.value, + DeviceTypeEnum.NETWORK.value, + DeviceTypeEnum.OPEN_LINE_SYSTEM.value, + DeviceTypeEnum.XR_CONSTELLATION.value, +} + +IGNORE_DEVICE_NAMES = { + NetworkTypeEnum.TE_OTN_TOPOLOGY: { + '128.32.10.1', '128.32.33.5', '128.32.20.5', '128.32.20.1', '128.32.10.5', 'nce-t' + }, + NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY: { + + }, +} - topology_name = topology_details.name - match = re.match(r'providerId\-([^\-]*)-clientId-([^\-]*)-topologyId-([^\-]*)', topology_name) +TE_TOPOLOGY_NAME = 'Huawei-Network' + +def compose_network(ietf_network_obj : network, te_topology_name : str, topology_details : TopologyDetails) -> None: + ietf_network_obj.te.name = TE_TOPOLOGY_NAME + + #te_topology_name = topology_details.name + match = re.match(r'providerId\-([^\-]*)-clientId-([^\-]*)-topologyId-([^\-]*)', te_topology_name) if match is not None: provider_id, client_id, topology_id = match.groups() ietf_network_obj.te_topology_identifier.provider_id = int(provider_id) @@ -57,12 +83,31 @@ def compose_network(ietf_network_obj : network, topology_details : TopologyDetai name_mappings = NameMappings() + ignore_device_uuids = set() + for device in topology_details.devices: + device_uuid = device.device_id.device_uuid.uuid + + device_type = device.device_type + if device_type in IGNORE_DEVICE_TYPES: + ignore_device_uuids.add(device_uuid) + continue + device_name = device.name + if device_name in IGNORE_DEVICE_NAMES.get(network_type, set()): + ignore_device_uuids.add(device_uuid) + continue + ietf_node_obj = ietf_network_obj.node.add(device_name) compose_node(ietf_node_obj, device, name_mappings, network_type) for link in topology_details.links: + link_device_uuids = { + endpoint_id.device_id.device_uuid.uuid + for endpoint_id in link.link_endpoint_ids + } + if len(ignore_device_uuids.intersection(link_device_uuids)) > 0: + continue link_name = link.name ietf_link_obj = ietf_network_obj.link.add(link_name) compose_link(ietf_link_obj, link, name_mappings, network_type) diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeNode.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeNode.py index 7467abb0e..a4b29d41d 100644 --- a/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeNode.py +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeNode.py @@ -21,18 +21,23 @@ from .NetworkTypeEnum import NetworkTypeEnum LOGGER = logging.getLogger(__name__) -NODE_NAME_MAPPINGS = { - '10.0.10.1': 'OA', - '10.0.20.1': 'P', - '10.0.30.1': 'OE', - '10.0.40.1': 'P', +MAPPINGS_TE_NODE_NAME = { + '10.0.10.1' : 'OA', + '10.0.20.1' : 'P', + '10.0.30.1' : 'OE', + '10.0.40.1' : 'P', + + '128.32.10.1': 'ONT1', + '128.32.20.1': 'ONT2', + '128.32.33.5': 'OLT', } +IGNORE_ENDPOINT_NAMES = {'mgmt', 'eth1'} + def compose_node( ietf_node_obj : node, device : Device, name_mappings : NameMappings, network_type : NetworkTypeEnum ) -> None: device_name = device.name - LOGGER.warning('network_type={:s} device_name={:s}'.format(str(network_type.value), str(device_name))) name_mappings.store_device_name(device) @@ -40,11 +45,11 @@ def compose_node( ietf_node_obj.te._set_oper_status('up') ietf_node_obj.te.te_node_attributes.admin_status = 'up' - ietf_node_obj.te.te_node_attributes.name = NODE_NAME_MAPPINGS.get(device_name, device_name) + ietf_node_obj.te.te_node_attributes.name = MAPPINGS_TE_NODE_NAME.get(device_name, device_name) for endpoint in device.device_endpoints: endpoint_name = endpoint.name - if endpoint_name == 'mgmt': continue + if endpoint_name in IGNORE_ENDPOINT_NAMES: continue if network_type == NetworkTypeEnum.TE_OTN_TOPOLOGY and endpoint.endpoint_type != 'optical': continue ietf_tp_obj = ietf_node_obj.termination_point.add(endpoint_name) @@ -91,3 +96,12 @@ def compose_node( ntaw._set_oper_status('up') ntaw.protection_type = 'ietf-te-types:lsp-protection-unprotected' ntaw.switching_capability = 'ietf-te-types:switching-otn' + elif network_type == NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY: + if device_name in {'128.32.33.5'}: + connectivity_matrices = ietf_node_obj.te.te_node_attributes.connectivity_matrices + lr0 = connectivity_matrices.label_restrictions.label_restriction.add(0) + lr0.label_start.te_label.vlanid = 21 + lr0.label_end.te_label.vlanid = 21 + lr1 = connectivity_matrices.label_restrictions.label_restriction.add(1) + lr1.label_start.te_label.vlanid = 31 + lr1.label_end.te_label.vlanid = 31 diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeTermPoint.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeTermPoint.py index 1533a9c0d..9b65782a7 100644 --- a/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeTermPoint.py +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/ComposeTermPoint.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +import logging from common.proto.context_pb2 import Device, EndPoint from .bindings.networks.network.node.termination_point import termination_point from .NameMapping import NameMappings @@ -36,36 +37,51 @@ MAPPINGS_TE_NAME = { (NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY, '10.0.10.1', '500'): 'endpoint:111', (NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY, '10.0.10.1', '501'): 'endpoint:111', - (NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY, '10.0.30.1', '200'): '172.10.33.254', + (NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY, '10.0.20.1', '500'): 'endpoint:111', + (NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY, '10.0.20.1', '501'): 'endpoint:111', + + (NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY, '10.0.30.1', '200'): 'endpoint:111', (NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY, '10.0.30.1', '500'): 'endpoint:111', (NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY, '10.0.30.1', '501'): 'endpoint:111', + + (NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY, '10.0.40.1', '500'): 'endpoint:111', + (NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY, '10.0.40.1', '501'): 'endpoint:111', + + (NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY, '128.32.33.5', '500') : 'endpoint:111', } MAPPINGS_TE_TP_ID = { (NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY, '10.0.10.1', '200'): '128.32.33.254', + (NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY, '10.0.30.1', '200'): '172.10.33.254', + + (NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY, '128.32.33.5', '500') : '128.32.33.2', } +LOGGER = logging.getLogger(__name__) + def compose_term_point( ietf_tp_obj : termination_point, device : Device, endpoint : EndPoint, name_mappings : NameMappings, network_type : NetworkTypeEnum ) -> None: name_mappings.store_endpoint_name(device, endpoint) - device_name = device.name + device_name = device.name endpoint_name = endpoint.name ietf_tp_obj.te_tp_id = MAPPINGS_TE_TP_ID.get((network_type, device_name, endpoint_name), endpoint_name) - ietf_tp_obj.te._set_oper_status('up') - ietf_tp_obj.te.admin_status = 'up' - ietf_tp_obj.te.name = MAPPINGS_TE_NAME.get((network_type, device_name, endpoint_name), endpoint_name) + if (network_type, device_name, endpoint_name) in MAPPINGS_TE_NAME: + ietf_tp_obj.te._set_oper_status('up') + ietf_tp_obj.te.admin_status = 'up' + ietf_tp_obj.te.name = MAPPINGS_TE_NAME.get((network_type, device_name, endpoint_name), endpoint_name) if network_type == NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY: - ietf_if_sw_cap = ietf_tp_obj.te.interface_switching_capability.add( - 'ietf-te-types:switching-l2sc ietf-te-types:lsp-encoding-ethernet' - ) - ietf_max_lsp_bw = ietf_if_sw_cap.max_lsp_bandwidth.add('7') - ietf_max_lsp_bw.te_bandwidth.eth_bandwidth = 10_000_000 # Kbps + if (network_type, device_name, endpoint_name) in MAPPINGS_TE_NAME: + ietf_if_sw_cap = ietf_tp_obj.te.interface_switching_capability.add( + 'ietf-te-types:switching-l2sc ietf-te-types:lsp-encoding-ethernet' + ) + ietf_max_lsp_bw = ietf_if_sw_cap.max_lsp_bandwidth.add('7') + ietf_max_lsp_bw.te_bandwidth.eth_bandwidth = 10_000_000 # Kbps #ietf_tp_obj.eth_svc.client_facing = True diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/ManualFixes.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/ManualFixes.py index 778fea586..ec95ee77f 100644 --- a/src/nbi/service/rest_server/nbi_plugins/ietf_network/ManualFixes.py +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/ManualFixes.py @@ -32,22 +32,19 @@ def manual_fixes(json_response : Dict) -> None: else: network_type = None - # Fix value type of for json_node in json_network.get('node', []): for json_tp in json_node.get('ietf-network-topology:termination-point', []): - - if json_node['node-id'] in {'10.0.10.1', '10.0.30.1'}: - if network_type == NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY: - if 'ietf-eth-te-topology:eth-svc' in json_tp: - client_facing = json_tp['tp-id'] == '200' - json_tp['ietf-eth-te-topology:eth-svc']['client-facing'] = client_facing - json_tp_te = json_tp.get('ietf-te-topology:te', {}) if network_type == NetworkTypeEnum.TE_OTN_TOPOLOGY: json_tp_te_cs = json_tp_te.setdefault('ietf-otn-topology:client-svc', {}) json_tp_te_cs['client-facing'] = False + elif network_type == NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY: + if 'ietf-eth-te-topology:eth-svc' in json_tp: + client_facing = json_tp['tp-id'] in {'200', '201'} + json_tp['ietf-eth-te-topology:eth-svc']['client-facing'] = client_facing + # Fix value type of bandwidth for json_if_sw_cap in json_tp_te.get('interface-switching-capability', []): for json_max_lsp_bandwidth in json_if_sw_cap.get('max-lsp-bandwidth', []): json_te_bw = json_max_lsp_bandwidth.get('te-bandwidth', {}) @@ -56,3 +53,21 @@ def manual_fixes(json_response : Dict) -> None: eth_bw = json_te_bw['ietf-eth-te-topology:eth-bandwidth'] if isinstance(eth_bw, str): json_te_bw['ietf-eth-te-topology:eth-bandwidth'] = int(eth_bw) + + for json_link in json_network.get('ietf-network-topology:link', []): + json_link_te_attributes = json_link.get('ietf-te-topology:te', {}).get('te-link-attributes', {}) + + # Fix value type of bandwidth + json_te_bw = json_link_te_attributes.get('max-link-bandwidth', {}).get('te-bandwidth', {}) + if network_type == NetworkTypeEnum.TE_ETH_TRAN_TOPOLOGY: + if 'ietf-eth-te-topology:eth-bandwidth' in json_te_bw: + eth_bw = json_te_bw['ietf-eth-te-topology:eth-bandwidth'] + if isinstance(eth_bw, str): + json_te_bw['ietf-eth-te-topology:eth-bandwidth'] = int(eth_bw) + + for json_unresv_bandwidth in json_link_te_attributes.get('unreserved-bandwidth', []): + json_te_bw = json_unresv_bandwidth.get('te-bandwidth', {}) + if 'ietf-eth-te-topology:eth-bandwidth' in json_te_bw: + eth_bw = json_te_bw['ietf-eth-te-topology:eth-bandwidth'] + if isinstance(eth_bw, str): + json_te_bw['ietf-eth-te-topology:eth-bandwidth'] = int(eth_bw) diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/Networks.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/Networks.py index 1571ffb04..47a126ec8 100644 --- a/src/nbi/service/rest_server/nbi_plugins/ietf_network/Networks.py +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/Networks.py @@ -18,9 +18,7 @@ from flask import request from flask.json import jsonify from flask_restful import Resource from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME -from common.proto.context_pb2 import ContextId from common.tools.context_queries.Topology import get_topology_details -from common.tools.object_factory.Context import json_context_id from context.client.ContextClient import ContextClient from nbi.service.rest_server.nbi_plugins.tools.Authentication import HTTP_AUTH from nbi.service.rest_server.nbi_plugins.tools.HttpStatusCodes import HTTP_OK, HTTP_SERVERERROR @@ -30,8 +28,10 @@ from .ManualFixes import manual_fixes LOGGER = logging.getLogger(__name__) -ADMIN_CONTEXT_UUIDS = {DEFAULT_CONTEXT_NAME} -ADMIN_TOPOLOGY_UUIDS = {DEFAULT_TOPOLOGY_NAME} +TE_TOPOLOGY_NAMES = [ + 'providerId-10-clientId-0-topologyId-1', + 'providerId-10-clientId-0-topologyId-2' +] class Networks(Resource): @HTTP_AUTH.login_required @@ -46,23 +46,16 @@ class Networks(Resource): ietf_nets = ietf_network() - topology_ids = context_client.ListTopologyIds(ContextId(**json_context_id(DEFAULT_CONTEXT_NAME))) - for topology_id in topology_ids.topology_ids: - context_uuid = topology_id.context_id.context_uuid.uuid - topology_uuid = topology_id.topology_uuid.uuid - if context_uuid in ADMIN_CONTEXT_UUIDS and topology_uuid in ADMIN_TOPOLOGY_UUIDS: continue + topology_details = get_topology_details( + context_client, DEFAULT_TOPOLOGY_NAME, context_uuid=DEFAULT_CONTEXT_NAME, #rw_copy=True + ) + if topology_details is None: + MSG = 'Topology({:s}/{:s}) not found' + raise Exception(MSG.format(DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME)) - topology_details = get_topology_details( - context_client, topology_uuid, context_uuid=context_uuid, rw_copy=True - ) - if topology_details is None: - MSG = 'Topology({:s}/{:s}) not found' - LOGGER.warning(MSG.format(context_uuid, topology_uuid)) - continue - - topology_name = topology_details.name - ietf_net = ietf_nets.networks.network.add(topology_name) - compose_network(ietf_net, topology_details) + for te_topology_name in TE_TOPOLOGY_NAMES: + ietf_net = ietf_nets.networks.network.add(te_topology_name) + compose_network(ietf_net, te_topology_name, topology_details) # TODO: improve these workarounds to enhance performance json_response = json.loads(pybindJSON.dumps(ietf_nets, mode='ietf')) diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/TODO.txt b/src/nbi/service/rest_server/nbi_plugins/ietf_network/_docs/test_commands.txt similarity index 94% rename from src/nbi/service/rest_server/nbi_plugins/ietf_network/TODO.txt rename to src/nbi/service/rest_server/nbi_plugins/ietf_network/_docs/test_commands.txt index 12d35c01c..78b2dd246 100644 --- a/src/nbi/service/rest_server/nbi_plugins/ietf_network/TODO.txt +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/_docs/test_commands.txt @@ -23,3 +23,4 @@ print(pybindJSON.dumps(ietf_nets_obj, mode='ietf')) ietf_link_obj.te.te_link_attributes.max_link_bandwidth.te_bandwidth.eth_bandwidth = 10_000_000 # Kbps unresv_bw = ietf_link_obj.te.te_link_attributes.unreserved_bandwidth.add(7) unresv_bw.te_bandwidth.eth_bandwidth = 10_000_000 # Kbps +print(pybindJSON.dumps(ietf_link_obj, mode='ietf')) diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/__init__.py new file mode 100644 index 000000000..6df50e1a6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/__init__.py @@ -0,0 +1,256 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class ietf_network_topology(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network-topology - based on the path /ietf-network-topology. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This module defines a common base model for a network topology, +augmenting the base network data model with links to connect +nodes, as well as termination points to terminate links +on nodes. + +Copyright (c) 2018 IETF Trust and the persons identified as +authors of the code. All rights reserved. + +Redistribution and use in source and binary forms, with or +without modification, is permitted pursuant to, and subject +to the license terms contained in, the Simplified BSD License +set forth in Section 4.c of the IETF Trust's Legal Provisions +Relating to IETF Documents +(https://trustee.ietf.org/license-info). + +This version of this YANG module is part of RFC 8345; +see the RFC itself for full legal notices. + """ + _pyangbind_elements = {} + + + +from . import networks +class ietf_network(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /ietf-network. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This module defines a common base data model for a collection +of nodes in a network. Node definitions are further used +in network topologies and inventories. + +Copyright (c) 2018 IETF Trust and the persons identified as +authors of the code. All rights reserved. + +Redistribution and use in source and binary forms, with or +without modification, is permitted pursuant to, and subject +to the license terms contained in, the Simplified BSD License +set forth in Section 4.c of the IETF Trust's Legal Provisions +Relating to IETF Documents +(https://trustee.ietf.org/license-info). + +This version of this YANG module is part of RFC 8345; +see the RFC itself for full legal notices. + """ + __slots__ = ('_path_helper', '_extmethods', '__networks',) + + _yang_name = 'ietf-network' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__networks = YANGDynClass(base=networks.networks, is_container='container', yang_name="networks", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return [] + + def _get_networks(self): + """ + Getter method for networks, mapped from YANG variable /networks (container) + + YANG Description: Serves as a top-level container for a list of networks. + """ + return self.__networks + + def _set_networks(self, v, load=False): + """ + Setter method for networks, mapped from YANG variable /networks (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_networks is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_networks() directly. + + YANG Description: Serves as a top-level container for a list of networks. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=networks.networks, is_container='container', yang_name="networks", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """networks must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=networks.networks, is_container='container', yang_name="networks", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='container', is_config=True)""", + }) + + self.__networks = t + if hasattr(self, '_set'): + self._set() + + def _unset_networks(self): + self.__networks = YANGDynClass(base=networks.networks, is_container='container', yang_name="networks", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='container', is_config=True) + + networks = __builtin__.property(_get_networks, _set_networks) + + + _pyangbind_elements = OrderedDict([('networks', networks), ]) + + +class ietf_te_topology(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-te-topology - based on the path /ietf-te-topology. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This YANG module defines a TE topology model for representing, +retrieving, and manipulating technology-agnostic TE topologies. + +Copyright (c) 2020 IETF Trust and the persons identified as +authors of the code. All rights reserved. + +Redistribution and use in source and binary forms, with or +without modification, is permitted pursuant to, and subject to +the license terms contained in, the Simplified BSD License set +forth in Section 4.c of the IETF Trust's Legal Provisions +Relating to IETF Documents +(https://trustee.ietf.org/license-info). + +This version of this YANG module is part of RFC 8795; see the +RFC itself for full legal notices. + """ + _pyangbind_elements = {} + + + +class ietf_otn_topology(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-otn-topology - based on the path /ietf-otn-topology. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This module defines a protocol independent Layer 1/ODU topology +data model. The model fully conforms +to the Network Management Datastore Architecture (NMDA). + +Copyright (c) 2023 IETF Trust and the persons identified +as authors of the code. All rights reserved. + +Redistribution and use in source and binary forms, with or +without modification, is permitted pursuant to, and subject +to the license terms contained in, the Revised BSD License +set forth in Section 4.c of the IETF Trust's Legal Provisions +Relating to IETF Documents +(https://trustee.ietf.org/license-info). + +This version of this YANG module is part of RFC XXXX; see +the RFC itself for full legal notices. + +The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL +NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED', +'MAY', and 'OPTIONAL' in this document are to be interpreted as +described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, +they appear in all capitals, as shown here. + """ + _pyangbind_elements = {} + + + +class ietf_eth_te_topology(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-eth-te-topology - based on the path /ietf-eth-te-topology. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This module defines a YANG data model for describing +layer-2 Ethernet transport topologies. The model fully +conforms to the Network Management Datastore +Architecture (NMDA). + +Copyright (c) 2023 IETF Trust and the persons identified +as authors of the code. All rights reserved. + +Redistribution and use in source and binary forms, with or +without modification, is permitted pursuant to, and subject +to the license terms contained in, the Revised BSD License +set forth in Section 4.c of the IETF Trust's Legal Provisions +Relating to IETF Documents +(https://trustee.ietf.org/license-info). + +This version of this YANG module is part of RFC XXXX; see +the RFC itself for full legal notices. + +The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL +NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED', +'MAY', and 'OPTIONAL' in this document are to be interpreted as +described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, +they appear in all capitals, as shown here. + """ + _pyangbind_elements = {} + + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/__init__.py new file mode 100644 index 000000000..0c52044eb --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/__init__.py @@ -0,0 +1,162 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import network +from . import te +class networks(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Serves as a top-level container for a list of networks. + """ + __slots__ = ('_path_helper', '_extmethods', '__network','__te',) + + _yang_name = 'networks' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__network = YANGDynClass(base=YANGListType("network_id",network.network, yang_name="network", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='network-id', extensions=None), is_container='list', yang_name="network", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='list', is_config=True) + self.__te = YANGDynClass(base=te.te, is_container='container', yang_name="te", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks'] + + def _get_network(self): + """ + Getter method for network, mapped from YANG variable /networks/network (list) + + YANG Description: Describes a network. +A network typically contains an inventory of nodes, +topological information (augmented through the +network-topology data model), and layering information. + """ + return self.__network + + def _set_network(self, v, load=False): + """ + Setter method for network, mapped from YANG variable /networks/network (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_network is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network() directly. + + YANG Description: Describes a network. +A network typically contains an inventory of nodes, +topological information (augmented through the +network-topology data model), and layering information. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("network_id",network.network, yang_name="network", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='network-id', extensions=None), is_container='list', yang_name="network", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("network_id",network.network, yang_name="network", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='network-id', extensions=None), is_container='list', yang_name="network", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='list', is_config=True)""", + }) + + self.__network = t + if hasattr(self, '_set'): + self._set() + + def _unset_network(self): + self.__network = YANGDynClass(base=YANGListType("network_id",network.network, yang_name="network", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='network-id', extensions=None), is_container='list', yang_name="network", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='list', is_config=True) + + + def _get_te(self): + """ + Getter method for te, mapped from YANG variable /networks/te (container) + + YANG Description: Indicates TE support. + """ + return self.__te + + def _set_te(self, v, load=False): + """ + Setter method for te, mapped from YANG variable /networks/te (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te() directly. + + YANG Description: Indicates TE support. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te.te, is_container='container', yang_name="te", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te.te, is_container='container', yang_name="te", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te = t + if hasattr(self, '_set'): + self._set() + + def _unset_te(self): + self.__te = YANGDynClass(base=te.te, is_container='container', yang_name="te", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + network = __builtin__.property(_get_network, _set_network) + te = __builtin__.property(_get_te, _set_te) + + + _pyangbind_elements = OrderedDict([('network', network), ('te', te), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/__init__.py new file mode 100644 index 000000000..302af85c9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/__init__.py @@ -0,0 +1,385 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import network_types +from . import supporting_network +from . import node +from . import link +from . import te_topology_identifier +from . import te +class network(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Describes a network. +A network typically contains an inventory of nodes, +topological information (augmented through the +network-topology data model), and layering information. + """ + __slots__ = ('_path_helper', '_extmethods', '__network_id','__network_types','__supporting_network','__node','__link','__te_topology_identifier','__te',) + + _yang_name = 'network' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__network_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='network-id', is_config=True) + self.__network_types = YANGDynClass(base=network_types.network_types, is_container='container', yang_name="network-types", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='container', is_config=True) + self.__supporting_network = YANGDynClass(base=YANGListType("network_ref",supporting_network.supporting_network, yang_name="supporting-network", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='network-ref', extensions=None), is_container='list', yang_name="supporting-network", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='list', is_config=True) + self.__node = YANGDynClass(base=YANGListType("node_id",node.node, yang_name="node", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='node-id', extensions=None), is_container='list', yang_name="node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='list', is_config=True) + self.__link = YANGDynClass(base=YANGListType("link_id",link.link, yang_name="link", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='link-id', extensions=None), is_container='list', yang_name="link", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='list', is_config=True) + self.__te_topology_identifier = YANGDynClass(base=te_topology_identifier.te_topology_identifier, is_container='container', yang_name="te-topology-identifier", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__te = YANGDynClass(base=te.te, is_container='container', yang_name="te", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network'] + + def _get_network_id(self): + """ + Getter method for network_id, mapped from YANG variable /networks/network/network_id (network-id) + + YANG Description: Identifies a network. + """ + return self.__network_id + + def _set_network_id(self, v, load=False): + """ + Setter method for network_id, mapped from YANG variable /networks/network/network_id (network-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_id() directly. + + YANG Description: Identifies a network. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='network-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_id must be of a type compatible with network-id""", + 'defined-type': "ietf-network:network-id", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='network-id', is_config=True)""", + }) + + self.__network_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_id(self): + self.__network_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='network-id', is_config=True) + + + def _get_network_types(self): + """ + Getter method for network_types, mapped from YANG variable /networks/network/network_types (container) + + YANG Description: Serves as an augmentation target. +The network type is indicated through corresponding +presence containers augmented into this container. + """ + return self.__network_types + + def _set_network_types(self, v, load=False): + """ + Setter method for network_types, mapped from YANG variable /networks/network/network_types (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_types is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_types() directly. + + YANG Description: Serves as an augmentation target. +The network type is indicated through corresponding +presence containers augmented into this container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=network_types.network_types, is_container='container', yang_name="network-types", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_types must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=network_types.network_types, is_container='container', yang_name="network-types", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='container', is_config=True)""", + }) + + self.__network_types = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_types(self): + self.__network_types = YANGDynClass(base=network_types.network_types, is_container='container', yang_name="network-types", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='container', is_config=True) + + + def _get_supporting_network(self): + """ + Getter method for supporting_network, mapped from YANG variable /networks/network/supporting_network (list) + + YANG Description: An underlay network, used to represent layered network +topologies. + """ + return self.__supporting_network + + def _set_supporting_network(self, v, load=False): + """ + Setter method for supporting_network, mapped from YANG variable /networks/network/supporting_network (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_supporting_network is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_supporting_network() directly. + + YANG Description: An underlay network, used to represent layered network +topologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("network_ref",supporting_network.supporting_network, yang_name="supporting-network", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='network-ref', extensions=None), is_container='list', yang_name="supporting-network", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """supporting_network must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("network_ref",supporting_network.supporting_network, yang_name="supporting-network", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='network-ref', extensions=None), is_container='list', yang_name="supporting-network", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='list', is_config=True)""", + }) + + self.__supporting_network = t + if hasattr(self, '_set'): + self._set() + + def _unset_supporting_network(self): + self.__supporting_network = YANGDynClass(base=YANGListType("network_ref",supporting_network.supporting_network, yang_name="supporting-network", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='network-ref', extensions=None), is_container='list', yang_name="supporting-network", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='list', is_config=True) + + + def _get_node(self): + """ + Getter method for node, mapped from YANG variable /networks/network/node (list) + + YANG Description: The inventory of nodes of this network. + """ + return self.__node + + def _set_node(self, v, load=False): + """ + Setter method for node, mapped from YANG variable /networks/network/node (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_node is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node() directly. + + YANG Description: The inventory of nodes of this network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("node_id",node.node, yang_name="node", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='node-id', extensions=None), is_container='list', yang_name="node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("node_id",node.node, yang_name="node", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='node-id', extensions=None), is_container='list', yang_name="node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='list', is_config=True)""", + }) + + self.__node = t + if hasattr(self, '_set'): + self._set() + + def _unset_node(self): + self.__node = YANGDynClass(base=YANGListType("node_id",node.node, yang_name="node", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='node-id', extensions=None), is_container='list', yang_name="node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='list', is_config=True) + + + def _get_link(self): + """ + Getter method for link, mapped from YANG variable /networks/network/link (list) + + YANG Description: A network link connects a local (source) node and +a remote (destination) node via a set of the respective +node's termination points. It is possible to have several +links between the same source and destination nodes. +Likewise, a link could potentially be re-homed between +termination points. Therefore, in order to ensure that we +would always know to distinguish between links, every link +is identified by a dedicated link identifier. Note that a +link models a point-to-point link, not a multipoint link. + """ + return self.__link + + def _set_link(self, v, load=False): + """ + Setter method for link, mapped from YANG variable /networks/network/link (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_link is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link() directly. + + YANG Description: A network link connects a local (source) node and +a remote (destination) node via a set of the respective +node's termination points. It is possible to have several +links between the same source and destination nodes. +Likewise, a link could potentially be re-homed between +termination points. Therefore, in order to ensure that we +would always know to distinguish between links, every link +is identified by a dedicated link identifier. Note that a +link models a point-to-point link, not a multipoint link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("link_id",link.link, yang_name="link", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='link-id', extensions=None), is_container='list', yang_name="link", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("link_id",link.link, yang_name="link", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='link-id', extensions=None), is_container='list', yang_name="link", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='list', is_config=True)""", + }) + + self.__link = t + if hasattr(self, '_set'): + self._set() + + def _unset_link(self): + self.__link = YANGDynClass(base=YANGListType("link_id",link.link, yang_name="link", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='link-id', extensions=None), is_container='list', yang_name="link", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='list', is_config=True) + + + def _get_te_topology_identifier(self): + """ + Getter method for te_topology_identifier, mapped from YANG variable /networks/network/te_topology_identifier (container) + + YANG Description: TE topology identifier container. + """ + return self.__te_topology_identifier + + def _set_te_topology_identifier(self, v, load=False): + """ + Setter method for te_topology_identifier, mapped from YANG variable /networks/network/te_topology_identifier (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_topology_identifier is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_topology_identifier() directly. + + YANG Description: TE topology identifier container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_topology_identifier.te_topology_identifier, is_container='container', yang_name="te-topology-identifier", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_topology_identifier must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_topology_identifier.te_topology_identifier, is_container='container', yang_name="te-topology-identifier", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_topology_identifier = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_topology_identifier(self): + self.__te_topology_identifier = YANGDynClass(base=te_topology_identifier.te_topology_identifier, is_container='container', yang_name="te-topology-identifier", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_te(self): + """ + Getter method for te, mapped from YANG variable /networks/network/te (container) + + YANG Description: Indicates TE support. + """ + return self.__te + + def _set_te(self, v, load=False): + """ + Setter method for te, mapped from YANG variable /networks/network/te (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te() directly. + + YANG Description: Indicates TE support. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te.te, is_container='container', yang_name="te", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te.te, is_container='container', yang_name="te", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te = t + if hasattr(self, '_set'): + self._set() + + def _unset_te(self): + self.__te = YANGDynClass(base=te.te, is_container='container', yang_name="te", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + network_id = __builtin__.property(_get_network_id, _set_network_id) + network_types = __builtin__.property(_get_network_types, _set_network_types) + supporting_network = __builtin__.property(_get_supporting_network, _set_supporting_network) + node = __builtin__.property(_get_node, _set_node) + link = __builtin__.property(_get_link, _set_link) + te_topology_identifier = __builtin__.property(_get_te_topology_identifier, _set_te_topology_identifier) + te = __builtin__.property(_get_te, _set_te) + + + _pyangbind_elements = OrderedDict([('network_id', network_id), ('network_types', network_types), ('supporting_network', supporting_network), ('node', node), ('link', link), ('te_topology_identifier', te_topology_identifier), ('te', te), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/__init__.py new file mode 100644 index 000000000..91937b156 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/__init__.py @@ -0,0 +1,294 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import source +from . import destination +from . import supporting_link +from . import te +class link(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A network link connects a local (source) node and +a remote (destination) node via a set of the respective +node's termination points. It is possible to have several +links between the same source and destination nodes. +Likewise, a link could potentially be re-homed between +termination points. Therefore, in order to ensure that we +would always know to distinguish between links, every link +is identified by a dedicated link identifier. Note that a +link models a point-to-point link, not a multipoint link. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_id','__source','__destination','__supporting_link','__te',) + + _yang_name = 'link' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="link-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='link-id', is_config=True) + self.__source = YANGDynClass(base=source.source, is_container='container', yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='container', is_config=True) + self.__destination = YANGDynClass(base=destination.destination, is_container='container', yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='container', is_config=True) + self.__supporting_link = YANGDynClass(base=YANGListType("network_ref link_ref",supporting_link.supporting_link, yang_name="supporting-link", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='network-ref link-ref', extensions=None), is_container='list', yang_name="supporting-link", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='list', is_config=True) + self.__te = YANGDynClass(base=te.te, is_container='container', yang_name="te", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link'] + + def _get_link_id(self): + """ + Getter method for link_id, mapped from YANG variable /networks/network/link/link_id (link-id) + + YANG Description: The identifier of a link in the topology. +A link is specific to a topology to which it belongs. + """ + return self.__link_id + + def _set_link_id(self, v, load=False): + """ + Setter method for link_id, mapped from YANG variable /networks/network/link/link_id (link-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_id() directly. + + YANG Description: The identifier of a link in the topology. +A link is specific to a topology to which it belongs. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="link-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='link-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_id must be of a type compatible with link-id""", + 'defined-type': "ietf-network-topology:link-id", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="link-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='link-id', is_config=True)""", + }) + + self.__link_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_id(self): + self.__link_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="link-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='link-id', is_config=True) + + + def _get_source(self): + """ + Getter method for source, mapped from YANG variable /networks/network/link/source (container) + + YANG Description: This container holds the logical source of a particular +link. + """ + return self.__source + + def _set_source(self, v, load=False): + """ + Setter method for source, mapped from YANG variable /networks/network/link/source (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_source is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_source() directly. + + YANG Description: This container holds the logical source of a particular +link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=source.source, is_container='container', yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """source must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=source.source, is_container='container', yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='container', is_config=True)""", + }) + + self.__source = t + if hasattr(self, '_set'): + self._set() + + def _unset_source(self): + self.__source = YANGDynClass(base=source.source, is_container='container', yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='container', is_config=True) + + + def _get_destination(self): + """ + Getter method for destination, mapped from YANG variable /networks/network/link/destination (container) + + YANG Description: This container holds the logical destination of a +particular link. + """ + return self.__destination + + def _set_destination(self, v, load=False): + """ + Setter method for destination, mapped from YANG variable /networks/network/link/destination (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_destination is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_destination() directly. + + YANG Description: This container holds the logical destination of a +particular link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=destination.destination, is_container='container', yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """destination must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=destination.destination, is_container='container', yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='container', is_config=True)""", + }) + + self.__destination = t + if hasattr(self, '_set'): + self._set() + + def _unset_destination(self): + self.__destination = YANGDynClass(base=destination.destination, is_container='container', yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='container', is_config=True) + + + def _get_supporting_link(self): + """ + Getter method for supporting_link, mapped from YANG variable /networks/network/link/supporting_link (list) + + YANG Description: Identifies the link or links on which this link depends. + """ + return self.__supporting_link + + def _set_supporting_link(self, v, load=False): + """ + Setter method for supporting_link, mapped from YANG variable /networks/network/link/supporting_link (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_supporting_link is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_supporting_link() directly. + + YANG Description: Identifies the link or links on which this link depends. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("network_ref link_ref",supporting_link.supporting_link, yang_name="supporting-link", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='network-ref link-ref', extensions=None), is_container='list', yang_name="supporting-link", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """supporting_link must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("network_ref link_ref",supporting_link.supporting_link, yang_name="supporting-link", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='network-ref link-ref', extensions=None), is_container='list', yang_name="supporting-link", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='list', is_config=True)""", + }) + + self.__supporting_link = t + if hasattr(self, '_set'): + self._set() + + def _unset_supporting_link(self): + self.__supporting_link = YANGDynClass(base=YANGListType("network_ref link_ref",supporting_link.supporting_link, yang_name="supporting-link", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='network-ref link-ref', extensions=None), is_container='list', yang_name="supporting-link", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='list', is_config=True) + + + def _get_te(self): + """ + Getter method for te, mapped from YANG variable /networks/network/link/te (container) + + YANG Description: Indicates TE support. + """ + return self.__te + + def _set_te(self, v, load=False): + """ + Setter method for te, mapped from YANG variable /networks/network/link/te (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te() directly. + + YANG Description: Indicates TE support. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te.te, is_container='container', yang_name="te", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te.te, is_container='container', yang_name="te", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te = t + if hasattr(self, '_set'): + self._set() + + def _unset_te(self): + self.__te = YANGDynClass(base=te.te, is_container='container', yang_name="te", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + link_id = __builtin__.property(_get_link_id, _set_link_id) + source = __builtin__.property(_get_source, _set_source) + destination = __builtin__.property(_get_destination, _set_destination) + supporting_link = __builtin__.property(_get_supporting_link, _set_supporting_link) + te = __builtin__.property(_get_te, _set_te) + + + _pyangbind_elements = OrderedDict([('link_id', link_id), ('source', source), ('destination', destination), ('supporting_link', supporting_link), ('te', te), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/destination/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/destination/__init__.py new file mode 100644 index 000000000..ddab21c3e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/destination/__init__.py @@ -0,0 +1,159 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class destination(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/destination. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This container holds the logical destination of a +particular link. + """ + __slots__ = ('_path_helper', '_extmethods', '__dest_node','__dest_tp',) + + _yang_name = 'destination' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__dest_node = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="dest-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + self.__dest_tp = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="dest-tp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'destination'] + + def _get_dest_node(self): + """ + Getter method for dest_node, mapped from YANG variable /networks/network/link/destination/dest_node (leafref) + + YANG Description: Destination node identifier. Must be in the same +network. + """ + return self.__dest_node + + def _set_dest_node(self, v, load=False): + """ + Setter method for dest_node, mapped from YANG variable /networks/network/link/destination/dest_node (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_dest_node is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_dest_node() directly. + + YANG Description: Destination node identifier. Must be in the same +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="dest-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """dest_node must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="dest-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True)""", + }) + + self.__dest_node = t + if hasattr(self, '_set'): + self._set() + + def _unset_dest_node(self): + self.__dest_node = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="dest-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + + + def _get_dest_tp(self): + """ + Getter method for dest_tp, mapped from YANG variable /networks/network/link/destination/dest_tp (leafref) + + YANG Description: This termination point is located within the +destination node and terminates the link. + """ + return self.__dest_tp + + def _set_dest_tp(self, v, load=False): + """ + Setter method for dest_tp, mapped from YANG variable /networks/network/link/destination/dest_tp (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_dest_tp is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_dest_tp() directly. + + YANG Description: This termination point is located within the +destination node and terminates the link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="dest-tp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """dest_tp must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="dest-tp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True)""", + }) + + self.__dest_tp = t + if hasattr(self, '_set'): + self._set() + + def _unset_dest_tp(self): + self.__dest_tp = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="dest-tp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + + dest_node = __builtin__.property(_get_dest_node, _set_dest_node) + dest_tp = __builtin__.property(_get_dest_tp, _set_dest_tp) + + + _pyangbind_elements = OrderedDict([('dest_node', dest_node), ('dest_tp', dest_tp), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/source/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/source/__init__.py new file mode 100644 index 000000000..7538dfd44 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/source/__init__.py @@ -0,0 +1,157 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class source(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/source. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This container holds the logical source of a particular +link. + """ + __slots__ = ('_path_helper', '_extmethods', '__source_node','__source_tp',) + + _yang_name = 'source' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__source_node = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + self.__source_tp = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-tp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'source'] + + def _get_source_node(self): + """ + Getter method for source_node, mapped from YANG variable /networks/network/link/source/source_node (leafref) + + YANG Description: Source node identifier. Must be in the same topology. + """ + return self.__source_node + + def _set_source_node(self, v, load=False): + """ + Setter method for source_node, mapped from YANG variable /networks/network/link/source/source_node (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_source_node is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_source_node() directly. + + YANG Description: Source node identifier. Must be in the same topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="source-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """source_node must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True)""", + }) + + self.__source_node = t + if hasattr(self, '_set'): + self._set() + + def _unset_source_node(self): + self.__source_node = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + + + def _get_source_tp(self): + """ + Getter method for source_tp, mapped from YANG variable /networks/network/link/source/source_tp (leafref) + + YANG Description: This termination point is located within the source node +and terminates the link. + """ + return self.__source_tp + + def _set_source_tp(self, v, load=False): + """ + Setter method for source_tp, mapped from YANG variable /networks/network/link/source/source_tp (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_source_tp is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_source_tp() directly. + + YANG Description: This termination point is located within the source node +and terminates the link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="source-tp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """source_tp must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-tp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True)""", + }) + + self.__source_tp = t + if hasattr(self, '_set'): + self._set() + + def _unset_source_tp(self): + self.__source_tp = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-tp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + + source_node = __builtin__.property(_get_source_node, _set_source_node) + source_tp = __builtin__.property(_get_source_tp, _set_source_tp) + + + _pyangbind_elements = OrderedDict([('source_node', source_node), ('source_tp', source_tp), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/supporting_link/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/supporting_link/__init__.py new file mode 100644 index 000000000..28a780f5f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/supporting_link/__init__.py @@ -0,0 +1,172 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class supporting_link(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/supporting-link. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Identifies the link or links on which this link depends. + """ + __slots__ = ('_path_helper', '_extmethods', '__network_ref','__link_ref',) + + _yang_name = 'supporting-link' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + self.__link_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="link-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'supporting-link'] + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/link/supporting_link/network_ref (leafref) + + YANG Description: This leaf identifies in which underlay topology +the supporting link is present. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/link/supporting_link/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: This leaf identifies in which underlay topology +the supporting link is present. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + + + def _get_link_ref(self): + """ + Getter method for link_ref, mapped from YANG variable /networks/network/link/supporting_link/link_ref (leafref) + + YANG Description: This leaf identifies a link that is a part +of this link's underlay. Reference loops in which +a link identifies itself as its underlay, either +directly or transitively, are not allowed. + """ + return self.__link_ref + + def _set_link_ref(self, v, load=False): + """ + Setter method for link_ref, mapped from YANG variable /networks/network/link/supporting_link/link_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_ref() directly. + + YANG Description: This leaf identifies a link that is a part +of this link's underlay. Reference loops in which +a link identifies itself as its underlay, either +directly or transitively, are not allowed. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="link-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="link-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True)""", + }) + + self.__link_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_ref(self): + self.__link_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="link-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + + network_ref = __builtin__.property(_get_network_ref, _set_network_ref) + link_ref = __builtin__.property(_get_link_ref, _set_link_ref) + + + _pyangbind_elements = OrderedDict([('network_ref', network_ref), ('link_ref', link_ref), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/__init__.py new file mode 100644 index 000000000..666d97181 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/__init__.py @@ -0,0 +1,603 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import bundled_links +from . import component_links +from . import te_link_attributes +from . import information_source_state +from . import information_source_entry +from . import recovery +from . import underlay +from . import statistics +class te(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Indicates TE support. + """ + __slots__ = ('_path_helper', '_extmethods', '__bundled_links','__component_links','__te_link_template','__te_link_attributes','__oper_status','__is_transitional','__information_source','__information_source_instance','__information_source_state','__information_source_entry','__recovery','__underlay','__statistics',) + + _yang_name = 'te' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__bundled_links = YANGDynClass(base=bundled_links.bundled_links, is_container='container', yang_name="bundled-links", parent=self, choice=('bundle-stack-level', 'bundle'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__component_links = YANGDynClass(base=component_links.component_links, is_container='container', yang_name="component-links", parent=self, choice=('bundle-stack-level', 'component'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__te_link_template = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="te-link-template", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + self.__te_link_attributes = YANGDynClass(base=te_link_attributes.te_link_attributes, is_container='container', yang_name="te-link-attributes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__oper_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-oper-status', is_config=False) + self.__is_transitional = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-transitional", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=False) + self.__information_source = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'unknown': {}, 'locally-configured': {}, 'ospfv2': {}, 'ospfv3': {}, 'isis': {}, 'bgp-ls': {}, 'system-processed': {}, 'other': {}},), is_leaf=True, yang_name="information-source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-info-source', is_config=False) + self.__information_source_instance = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="information-source-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + self.__information_source_state = YANGDynClass(base=information_source_state.information_source_state, is_container='container', yang_name="information-source-state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__information_source_entry = YANGDynClass(base=YANGListType("information_source information_source_instance",information_source_entry.information_source_entry, yang_name="information-source-entry", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='information-source information-source-instance', extensions=None), is_container='list', yang_name="information-source-entry", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + self.__recovery = YANGDynClass(base=recovery.recovery, is_container='container', yang_name="recovery", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__underlay = YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__statistics = YANGDynClass(base=statistics.statistics, is_container='container', yang_name="statistics", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te'] + + def _get_bundled_links(self): + """ + Getter method for bundled_links, mapped from YANG variable /networks/network/link/te/bundled_links (container) + + YANG Description: A set of bundled links. + """ + return self.__bundled_links + + def _set_bundled_links(self, v, load=False): + """ + Setter method for bundled_links, mapped from YANG variable /networks/network/link/te/bundled_links (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_bundled_links is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_bundled_links() directly. + + YANG Description: A set of bundled links. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=bundled_links.bundled_links, is_container='container', yang_name="bundled-links", parent=self, choice=('bundle-stack-level', 'bundle'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """bundled_links must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=bundled_links.bundled_links, is_container='container', yang_name="bundled-links", parent=self, choice=('bundle-stack-level', 'bundle'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__bundled_links = t + if hasattr(self, '_set'): + self._set() + + def _unset_bundled_links(self): + self.__bundled_links = YANGDynClass(base=bundled_links.bundled_links, is_container='container', yang_name="bundled-links", parent=self, choice=('bundle-stack-level', 'bundle'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_component_links(self): + """ + Getter method for component_links, mapped from YANG variable /networks/network/link/te/component_links (container) + + YANG Description: A set of component links. + """ + return self.__component_links + + def _set_component_links(self, v, load=False): + """ + Setter method for component_links, mapped from YANG variable /networks/network/link/te/component_links (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_component_links is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_component_links() directly. + + YANG Description: A set of component links. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=component_links.component_links, is_container='container', yang_name="component-links", parent=self, choice=('bundle-stack-level', 'component'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """component_links must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=component_links.component_links, is_container='container', yang_name="component-links", parent=self, choice=('bundle-stack-level', 'component'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__component_links = t + if hasattr(self, '_set'): + self._set() + + def _unset_component_links(self): + self.__component_links = YANGDynClass(base=component_links.component_links, is_container='container', yang_name="component-links", parent=self, choice=('bundle-stack-level', 'component'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_te_link_template(self): + """ + Getter method for te_link_template, mapped from YANG variable /networks/network/link/te/te_link_template (leafref) + + YANG Description: The reference to a TE link template. + """ + return self.__te_link_template + + def _set_te_link_template(self, v, load=False): + """ + Setter method for te_link_template, mapped from YANG variable /networks/network/link/te/te_link_template (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_link_template is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_link_template() directly. + + YANG Description: The reference to a TE link template. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="te-link-template", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_link_template must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="te-link-template", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__te_link_template = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_link_template(self): + self.__te_link_template = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="te-link-template", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + + def _get_te_link_attributes(self): + """ + Getter method for te_link_attributes, mapped from YANG variable /networks/network/link/te/te_link_attributes (container) + + YANG Description: Link attributes in a TE topology. + """ + return self.__te_link_attributes + + def _set_te_link_attributes(self, v, load=False): + """ + Setter method for te_link_attributes, mapped from YANG variable /networks/network/link/te/te_link_attributes (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_link_attributes is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_link_attributes() directly. + + YANG Description: Link attributes in a TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_link_attributes.te_link_attributes, is_container='container', yang_name="te-link-attributes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_link_attributes must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_link_attributes.te_link_attributes, is_container='container', yang_name="te-link-attributes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_link_attributes = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_link_attributes(self): + self.__te_link_attributes = YANGDynClass(base=te_link_attributes.te_link_attributes, is_container='container', yang_name="te-link-attributes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_oper_status(self): + """ + Getter method for oper_status, mapped from YANG variable /networks/network/link/te/oper_status (te-types:te-oper-status) + + YANG Description: The current operational state of the link. + """ + return self.__oper_status + + def _set_oper_status(self, v, load=False): + """ + Setter method for oper_status, mapped from YANG variable /networks/network/link/te/oper_status (te-types:te-oper-status) + If this variable is read-only (config: false) in the + source YANG file, then _set_oper_status is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_oper_status() directly. + + YANG Description: The current operational state of the link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-oper-status', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """oper_status must be of a type compatible with te-types:te-oper-status""", + 'defined-type': "te-types:te-oper-status", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-oper-status', is_config=False)""", + }) + + self.__oper_status = t + if hasattr(self, '_set'): + self._set() + + def _unset_oper_status(self): + self.__oper_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-oper-status', is_config=False) + + + def _get_is_transitional(self): + """ + Getter method for is_transitional, mapped from YANG variable /networks/network/link/te/is_transitional (empty) + + YANG Description: Present if the link is transitional; used as an +alternative approach in lieu of 'inter-layer-lock-id' +for path computation in a TE topology covering multiple +layers or multiple regions. + """ + return self.__is_transitional + + def _set_is_transitional(self, v, load=False): + """ + Setter method for is_transitional, mapped from YANG variable /networks/network/link/te/is_transitional (empty) + If this variable is read-only (config: false) in the + source YANG file, then _set_is_transitional is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_is_transitional() directly. + + YANG Description: Present if the link is transitional; used as an +alternative approach in lieu of 'inter-layer-lock-id' +for path computation in a TE topology covering multiple +layers or multiple regions. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="is-transitional", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """is_transitional must be of a type compatible with empty""", + 'defined-type': "empty", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-transitional", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=False)""", + }) + + self.__is_transitional = t + if hasattr(self, '_set'): + self._set() + + def _unset_is_transitional(self): + self.__is_transitional = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-transitional", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=False) + + + def _get_information_source(self): + """ + Getter method for information_source, mapped from YANG variable /networks/network/link/te/information_source (te-info-source) + + YANG Description: Indicates the type of information source. + """ + return self.__information_source + + def _set_information_source(self, v, load=False): + """ + Setter method for information_source, mapped from YANG variable /networks/network/link/te/information_source (te-info-source) + If this variable is read-only (config: false) in the + source YANG file, then _set_information_source is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_information_source() directly. + + YANG Description: Indicates the type of information source. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'unknown': {}, 'locally-configured': {}, 'ospfv2': {}, 'ospfv3': {}, 'isis': {}, 'bgp-ls': {}, 'system-processed': {}, 'other': {}},), is_leaf=True, yang_name="information-source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-info-source', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """information_source must be of a type compatible with te-info-source""", + 'defined-type': "ietf-te-topology:te-info-source", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'unknown': {}, 'locally-configured': {}, 'ospfv2': {}, 'ospfv3': {}, 'isis': {}, 'bgp-ls': {}, 'system-processed': {}, 'other': {}},), is_leaf=True, yang_name="information-source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-info-source', is_config=False)""", + }) + + self.__information_source = t + if hasattr(self, '_set'): + self._set() + + def _unset_information_source(self): + self.__information_source = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'unknown': {}, 'locally-configured': {}, 'ospfv2': {}, 'ospfv3': {}, 'isis': {}, 'bgp-ls': {}, 'system-processed': {}, 'other': {}},), is_leaf=True, yang_name="information-source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-info-source', is_config=False) + + + def _get_information_source_instance(self): + """ + Getter method for information_source_instance, mapped from YANG variable /networks/network/link/te/information_source_instance (string) + + YANG Description: The name indicating the instance of the information +source. + """ + return self.__information_source_instance + + def _set_information_source_instance(self, v, load=False): + """ + Setter method for information_source_instance, mapped from YANG variable /networks/network/link/te/information_source_instance (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_information_source_instance is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_information_source_instance() directly. + + YANG Description: The name indicating the instance of the information +source. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="information-source-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """information_source_instance must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="information-source-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__information_source_instance = t + if hasattr(self, '_set'): + self._set() + + def _unset_information_source_instance(self): + self.__information_source_instance = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="information-source-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + + def _get_information_source_state(self): + """ + Getter method for information_source_state, mapped from YANG variable /networks/network/link/te/information_source_state (container) + + YANG Description: Contains state attributes related to the information +source. + """ + return self.__information_source_state + + def _set_information_source_state(self, v, load=False): + """ + Setter method for information_source_state, mapped from YANG variable /networks/network/link/te/information_source_state (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_information_source_state is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_information_source_state() directly. + + YANG Description: Contains state attributes related to the information +source. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=information_source_state.information_source_state, is_container='container', yang_name="information-source-state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """information_source_state must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=information_source_state.information_source_state, is_container='container', yang_name="information-source-state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__information_source_state = t + if hasattr(self, '_set'): + self._set() + + def _unset_information_source_state(self): + self.__information_source_state = YANGDynClass(base=information_source_state.information_source_state, is_container='container', yang_name="information-source-state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_information_source_entry(self): + """ + Getter method for information_source_entry, mapped from YANG variable /networks/network/link/te/information_source_entry (list) + + YANG Description: A list of information sources learned, including the source +that is used. + """ + return self.__information_source_entry + + def _set_information_source_entry(self, v, load=False): + """ + Setter method for information_source_entry, mapped from YANG variable /networks/network/link/te/information_source_entry (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_information_source_entry is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_information_source_entry() directly. + + YANG Description: A list of information sources learned, including the source +that is used. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("information_source information_source_instance",information_source_entry.information_source_entry, yang_name="information-source-entry", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='information-source information-source-instance', extensions=None), is_container='list', yang_name="information-source-entry", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """information_source_entry must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("information_source information_source_instance",information_source_entry.information_source_entry, yang_name="information-source-entry", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='information-source information-source-instance', extensions=None), is_container='list', yang_name="information-source-entry", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__information_source_entry = t + if hasattr(self, '_set'): + self._set() + + def _unset_information_source_entry(self): + self.__information_source_entry = YANGDynClass(base=YANGListType("information_source information_source_instance",information_source_entry.information_source_entry, yang_name="information-source-entry", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='information-source information-source-instance', extensions=None), is_container='list', yang_name="information-source-entry", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + + def _get_recovery(self): + """ + Getter method for recovery, mapped from YANG variable /networks/network/link/te/recovery (container) + + YANG Description: Status of the recovery process. + """ + return self.__recovery + + def _set_recovery(self, v, load=False): + """ + Setter method for recovery, mapped from YANG variable /networks/network/link/te/recovery (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_recovery is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_recovery() directly. + + YANG Description: Status of the recovery process. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=recovery.recovery, is_container='container', yang_name="recovery", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """recovery must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=recovery.recovery, is_container='container', yang_name="recovery", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__recovery = t + if hasattr(self, '_set'): + self._set() + + def _unset_recovery(self): + self.__recovery = YANGDynClass(base=recovery.recovery, is_container='container', yang_name="recovery", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_underlay(self): + """ + Getter method for underlay, mapped from YANG variable /networks/network/link/te/underlay (container) + + YANG Description: State attributes for the TE link underlay. + """ + return self.__underlay + + def _set_underlay(self, v, load=False): + """ + Setter method for underlay, mapped from YANG variable /networks/network/link/te/underlay (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_underlay is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_underlay() directly. + + YANG Description: State attributes for the TE link underlay. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """underlay must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__underlay = t + if hasattr(self, '_set'): + self._set() + + def _unset_underlay(self): + self.__underlay = YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_statistics(self): + """ + Getter method for statistics, mapped from YANG variable /networks/network/link/te/statistics (container) + + YANG Description: Statistics data. + """ + return self.__statistics + + def _set_statistics(self, v, load=False): + """ + Setter method for statistics, mapped from YANG variable /networks/network/link/te/statistics (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_statistics is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_statistics() directly. + + YANG Description: Statistics data. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=statistics.statistics, is_container='container', yang_name="statistics", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """statistics must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=statistics.statistics, is_container='container', yang_name="statistics", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__statistics = t + if hasattr(self, '_set'): + self._set() + + def _unset_statistics(self): + self.__statistics = YANGDynClass(base=statistics.statistics, is_container='container', yang_name="statistics", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + bundled_links = __builtin__.property(_get_bundled_links, _set_bundled_links) + component_links = __builtin__.property(_get_component_links, _set_component_links) + te_link_template = __builtin__.property(_get_te_link_template, _set_te_link_template) + te_link_attributes = __builtin__.property(_get_te_link_attributes, _set_te_link_attributes) + oper_status = __builtin__.property(_get_oper_status) + is_transitional = __builtin__.property(_get_is_transitional) + information_source = __builtin__.property(_get_information_source) + information_source_instance = __builtin__.property(_get_information_source_instance) + information_source_state = __builtin__.property(_get_information_source_state) + information_source_entry = __builtin__.property(_get_information_source_entry) + recovery = __builtin__.property(_get_recovery) + underlay = __builtin__.property(_get_underlay) + statistics = __builtin__.property(_get_statistics) + + __choices__ = {'bundle-stack-level': {'bundle': ['bundled_links'], 'component': ['component_links']}} + _pyangbind_elements = OrderedDict([('bundled_links', bundled_links), ('component_links', component_links), ('te_link_template', te_link_template), ('te_link_attributes', te_link_attributes), ('oper_status', oper_status), ('is_transitional', is_transitional), ('information_source', information_source), ('information_source_instance', information_source_instance), ('information_source_state', information_source_state), ('information_source_entry', information_source_entry), ('recovery', recovery), ('underlay', underlay), ('statistics', statistics), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/bundled_links/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/bundled_links/__init__.py new file mode 100644 index 000000000..890484652 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/bundled_links/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import bundled_link +class bundled_links(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/bundled-links. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A set of bundled links. + """ + __slots__ = ('_path_helper', '_extmethods', '__bundled_link',) + + _yang_name = 'bundled-links' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__bundled_link = YANGDynClass(base=YANGListType("sequence",bundled_link.bundled_link, yang_name="bundled-link", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='sequence', extensions=None, choice=('bundle-stack-level', 'bundle')), is_container='list', yang_name="bundled-link", parent=self, choice=('bundle-stack-level', 'bundle'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'bundled-links'] + + def _get_bundled_link(self): + """ + Getter method for bundled_link, mapped from YANG variable /networks/network/link/te/bundled_links/bundled_link (list) + + YANG Description: Specifies a bundled interface that is +further partitioned. + """ + return self.__bundled_link + + def _set_bundled_link(self, v, load=False): + """ + Setter method for bundled_link, mapped from YANG variable /networks/network/link/te/bundled_links/bundled_link (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_bundled_link is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_bundled_link() directly. + + YANG Description: Specifies a bundled interface that is +further partitioned. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("sequence",bundled_link.bundled_link, yang_name="bundled-link", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='sequence', extensions=None, choice=('bundle-stack-level', 'bundle')), is_container='list', yang_name="bundled-link", parent=self, choice=('bundle-stack-level', 'bundle'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """bundled_link must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("sequence",bundled_link.bundled_link, yang_name="bundled-link", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='sequence', extensions=None, choice=('bundle-stack-level', 'bundle')), is_container='list', yang_name="bundled-link", parent=self, choice=('bundle-stack-level', 'bundle'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__bundled_link = t + if hasattr(self, '_set'): + self._set() + + def _unset_bundled_link(self): + self.__bundled_link = YANGDynClass(base=YANGListType("sequence",bundled_link.bundled_link, yang_name="bundled-link", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='sequence', extensions=None, choice=('bundle-stack-level', 'bundle')), is_container='list', yang_name="bundled-link", parent=self, choice=('bundle-stack-level', 'bundle'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + bundled_link = __builtin__.property(_get_bundled_link, _set_bundled_link) + + __choices__ = {'bundle-stack-level': {'bundle': ['bundled_link']}} + _pyangbind_elements = OrderedDict([('bundled_link', bundled_link), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/bundled_links/bundled_link/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/bundled_links/bundled_link/__init__.py new file mode 100644 index 000000000..99c0b71fe --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/bundled_links/bundled_link/__init__.py @@ -0,0 +1,203 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class bundled_link(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/bundled-links/bundled-link. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Specifies a bundled interface that is +further partitioned. + """ + __slots__ = ('_path_helper', '_extmethods', '__sequence','__src_tp_ref','__des_tp_ref',) + + _yang_name = 'bundled-link' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__sequence = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="sequence", parent=self, choice=('bundle-stack-level', 'bundle'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__src_tp_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="src-tp-ref", parent=self, choice=('bundle-stack-level', 'bundle'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + self.__des_tp_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="des-tp-ref", parent=self, choice=('bundle-stack-level', 'bundle'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'bundled-links', 'bundled-link'] + + def _get_sequence(self): + """ + Getter method for sequence, mapped from YANG variable /networks/network/link/te/bundled_links/bundled_link/sequence (uint32) + + YANG Description: Identifies the sequence in the bundle. + """ + return self.__sequence + + def _set_sequence(self, v, load=False): + """ + Setter method for sequence, mapped from YANG variable /networks/network/link/te/bundled_links/bundled_link/sequence (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_sequence is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_sequence() directly. + + YANG Description: Identifies the sequence in the bundle. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="sequence", parent=self, choice=('bundle-stack-level', 'bundle'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """sequence must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="sequence", parent=self, choice=('bundle-stack-level', 'bundle'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__sequence = t + if hasattr(self, '_set'): + self._set() + + def _unset_sequence(self): + self.__sequence = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="sequence", parent=self, choice=('bundle-stack-level', 'bundle'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_src_tp_ref(self): + """ + Getter method for src_tp_ref, mapped from YANG variable /networks/network/link/te/bundled_links/bundled_link/src_tp_ref (leafref) + + YANG Description: Reference to another TE termination point on the +same source node. + """ + return self.__src_tp_ref + + def _set_src_tp_ref(self, v, load=False): + """ + Setter method for src_tp_ref, mapped from YANG variable /networks/network/link/te/bundled_links/bundled_link/src_tp_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_src_tp_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_src_tp_ref() directly. + + YANG Description: Reference to another TE termination point on the +same source node. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="src-tp-ref", parent=self, choice=('bundle-stack-level', 'bundle'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """src_tp_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="src-tp-ref", parent=self, choice=('bundle-stack-level', 'bundle'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__src_tp_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_src_tp_ref(self): + self.__src_tp_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="src-tp-ref", parent=self, choice=('bundle-stack-level', 'bundle'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + + def _get_des_tp_ref(self): + """ + Getter method for des_tp_ref, mapped from YANG variable /networks/network/link/te/bundled_links/bundled_link/des_tp_ref (leafref) + + YANG Description: Reference to another TE termination point on the +same destination node. + """ + return self.__des_tp_ref + + def _set_des_tp_ref(self, v, load=False): + """ + Setter method for des_tp_ref, mapped from YANG variable /networks/network/link/te/bundled_links/bundled_link/des_tp_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_des_tp_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_des_tp_ref() directly. + + YANG Description: Reference to another TE termination point on the +same destination node. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="des-tp-ref", parent=self, choice=('bundle-stack-level', 'bundle'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """des_tp_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="des-tp-ref", parent=self, choice=('bundle-stack-level', 'bundle'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__des_tp_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_des_tp_ref(self): + self.__des_tp_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="des-tp-ref", parent=self, choice=('bundle-stack-level', 'bundle'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + sequence = __builtin__.property(_get_sequence, _set_sequence) + src_tp_ref = __builtin__.property(_get_src_tp_ref, _set_src_tp_ref) + des_tp_ref = __builtin__.property(_get_des_tp_ref, _set_des_tp_ref) + + __choices__ = {'bundle-stack-level': {'bundle': ['sequence', 'src_tp_ref', 'des_tp_ref']}} + _pyangbind_elements = OrderedDict([('sequence', sequence), ('src_tp_ref', src_tp_ref), ('des_tp_ref', des_tp_ref), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/component_links/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/component_links/__init__.py new file mode 100644 index 000000000..2207417bc --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/component_links/__init__.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import component_link +class component_links(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/component-links. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A set of component links. + """ + __slots__ = ('_path_helper', '_extmethods', '__component_link',) + + _yang_name = 'component-links' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__component_link = YANGDynClass(base=YANGListType("sequence",component_link.component_link, yang_name="component-link", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='sequence', extensions=None, choice=('bundle-stack-level', 'component')), is_container='list', yang_name="component-link", parent=self, choice=('bundle-stack-level', 'component'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'component-links'] + + def _get_component_link(self): + """ + Getter method for component_link, mapped from YANG variable /networks/network/link/te/component_links/component_link (list) + + YANG Description: Specifies a component interface that is +sufficient to unambiguously identify the +appropriate resources. + """ + return self.__component_link + + def _set_component_link(self, v, load=False): + """ + Setter method for component_link, mapped from YANG variable /networks/network/link/te/component_links/component_link (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_component_link is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_component_link() directly. + + YANG Description: Specifies a component interface that is +sufficient to unambiguously identify the +appropriate resources. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("sequence",component_link.component_link, yang_name="component-link", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='sequence', extensions=None, choice=('bundle-stack-level', 'component')), is_container='list', yang_name="component-link", parent=self, choice=('bundle-stack-level', 'component'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """component_link must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("sequence",component_link.component_link, yang_name="component-link", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='sequence', extensions=None, choice=('bundle-stack-level', 'component')), is_container='list', yang_name="component-link", parent=self, choice=('bundle-stack-level', 'component'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__component_link = t + if hasattr(self, '_set'): + self._set() + + def _unset_component_link(self): + self.__component_link = YANGDynClass(base=YANGListType("sequence",component_link.component_link, yang_name="component-link", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='sequence', extensions=None, choice=('bundle-stack-level', 'component')), is_container='list', yang_name="component-link", parent=self, choice=('bundle-stack-level', 'component'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + component_link = __builtin__.property(_get_component_link, _set_component_link) + + __choices__ = {'bundle-stack-level': {'component': ['component_link']}} + _pyangbind_elements = OrderedDict([('component_link', component_link), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/component_links/component_link/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/component_links/component_link/__init__.py new file mode 100644 index 000000000..5995318d7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/component_links/component_link/__init__.py @@ -0,0 +1,204 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class component_link(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/component-links/component-link. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Specifies a component interface that is +sufficient to unambiguously identify the +appropriate resources. + """ + __slots__ = ('_path_helper', '_extmethods', '__sequence','__src_interface_ref','__des_interface_ref',) + + _yang_name = 'component-link' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__sequence = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="sequence", parent=self, choice=('bundle-stack-level', 'component'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__src_interface_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="src-interface-ref", parent=self, choice=('bundle-stack-level', 'component'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + self.__des_interface_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="des-interface-ref", parent=self, choice=('bundle-stack-level', 'component'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'component-links', 'component-link'] + + def _get_sequence(self): + """ + Getter method for sequence, mapped from YANG variable /networks/network/link/te/component_links/component_link/sequence (uint32) + + YANG Description: Identifies the sequence in the bundle. + """ + return self.__sequence + + def _set_sequence(self, v, load=False): + """ + Setter method for sequence, mapped from YANG variable /networks/network/link/te/component_links/component_link/sequence (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_sequence is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_sequence() directly. + + YANG Description: Identifies the sequence in the bundle. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="sequence", parent=self, choice=('bundle-stack-level', 'component'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """sequence must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="sequence", parent=self, choice=('bundle-stack-level', 'component'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__sequence = t + if hasattr(self, '_set'): + self._set() + + def _unset_sequence(self): + self.__sequence = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="sequence", parent=self, choice=('bundle-stack-level', 'component'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_src_interface_ref(self): + """ + Getter method for src_interface_ref, mapped from YANG variable /networks/network/link/te/component_links/component_link/src_interface_ref (string) + + YANG Description: Reference to a component link interface on the +source node. + """ + return self.__src_interface_ref + + def _set_src_interface_ref(self, v, load=False): + """ + Setter method for src_interface_ref, mapped from YANG variable /networks/network/link/te/component_links/component_link/src_interface_ref (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_src_interface_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_src_interface_ref() directly. + + YANG Description: Reference to a component link interface on the +source node. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="src-interface-ref", parent=self, choice=('bundle-stack-level', 'component'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """src_interface_ref must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="src-interface-ref", parent=self, choice=('bundle-stack-level', 'component'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True)""", + }) + + self.__src_interface_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_src_interface_ref(self): + self.__src_interface_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="src-interface-ref", parent=self, choice=('bundle-stack-level', 'component'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + + def _get_des_interface_ref(self): + """ + Getter method for des_interface_ref, mapped from YANG variable /networks/network/link/te/component_links/component_link/des_interface_ref (string) + + YANG Description: Reference to a component link interface on the +destination node. + """ + return self.__des_interface_ref + + def _set_des_interface_ref(self, v, load=False): + """ + Setter method for des_interface_ref, mapped from YANG variable /networks/network/link/te/component_links/component_link/des_interface_ref (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_des_interface_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_des_interface_ref() directly. + + YANG Description: Reference to a component link interface on the +destination node. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="des-interface-ref", parent=self, choice=('bundle-stack-level', 'component'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """des_interface_ref must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="des-interface-ref", parent=self, choice=('bundle-stack-level', 'component'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True)""", + }) + + self.__des_interface_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_des_interface_ref(self): + self.__des_interface_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="des-interface-ref", parent=self, choice=('bundle-stack-level', 'component'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + sequence = __builtin__.property(_get_sequence, _set_sequence) + src_interface_ref = __builtin__.property(_get_src_interface_ref, _set_src_interface_ref) + des_interface_ref = __builtin__.property(_get_des_interface_ref, _set_des_interface_ref) + + __choices__ = {'bundle-stack-level': {'component': ['sequence', 'src_interface_ref', 'des_interface_ref']}} + _pyangbind_elements = OrderedDict([('sequence', sequence), ('src_interface_ref', src_interface_ref), ('des_interface_ref', des_interface_ref), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/__init__.py new file mode 100644 index 000000000..d331b67df --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/__init__.py @@ -0,0 +1,749 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import information_source_state +from . import interface_switching_capability +from . import label_restrictions +from . import max_link_bandwidth +from . import max_resv_link_bandwidth +from . import unreserved_bandwidth +from . import te_srlgs +from . import te_nsrlgs +class information_source_entry(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of information sources learned, including the source +that is used. + """ + __slots__ = ('_path_helper', '_extmethods', '__information_source','__information_source_instance','__information_source_state','__link_index','__administrative_group','__interface_switching_capability','__label_restrictions','__link_protection_type','__max_link_bandwidth','__max_resv_link_bandwidth','__unreserved_bandwidth','__te_default_metric','__te_delay_metric','__te_igp_metric','__te_srlgs','__te_nsrlgs',) + + _yang_name = 'information-source-entry' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__information_source = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'unknown': {}, 'locally-configured': {}, 'ospfv2': {}, 'ospfv3': {}, 'isis': {}, 'bgp-ls': {}, 'system-processed': {}, 'other': {}},), is_leaf=True, yang_name="information-source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-info-source', is_config=False) + self.__information_source_instance = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="information-source-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + self.__information_source_state = YANGDynClass(base=information_source_state.information_source_state, is_container='container', yang_name="information-source-state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__link_index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="link-index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + self.__administrative_group = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], is_leaf=True, yang_name="administrative-group", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:admin-groups', is_config=False) + self.__interface_switching_capability = YANGDynClass(base=YANGListType("switching_capability encoding",interface_switching_capability.interface_switching_capability, yang_name="interface-switching-capability", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='switching-capability encoding', extensions=None), is_container='list', yang_name="interface-switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + self.__label_restrictions = YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__link_protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="link-protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__max_link_bandwidth = YANGDynClass(base=max_link_bandwidth.max_link_bandwidth, is_container='container', yang_name="max-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__max_resv_link_bandwidth = YANGDynClass(base=max_resv_link_bandwidth.max_resv_link_bandwidth, is_container='container', yang_name="max-resv-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__unreserved_bandwidth = YANGDynClass(base=YANGListType("priority",unreserved_bandwidth.unreserved_bandwidth, yang_name="unreserved-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="unreserved-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + self.__te_default_metric = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-default-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__te_delay_metric = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-delay-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__te_igp_metric = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-igp-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__te_srlgs = YANGDynClass(base=te_srlgs.te_srlgs, is_container='container', yang_name="te-srlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__te_nsrlgs = YANGDynClass(base=te_nsrlgs.te_nsrlgs, is_container='container', yang_name="te-nsrlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'information-source-entry'] + + def _get_information_source(self): + """ + Getter method for information_source, mapped from YANG variable /networks/network/link/te/information_source_entry/information_source (te-info-source) + + YANG Description: Indicates the type of information source. + """ + return self.__information_source + + def _set_information_source(self, v, load=False): + """ + Setter method for information_source, mapped from YANG variable /networks/network/link/te/information_source_entry/information_source (te-info-source) + If this variable is read-only (config: false) in the + source YANG file, then _set_information_source is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_information_source() directly. + + YANG Description: Indicates the type of information source. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'unknown': {}, 'locally-configured': {}, 'ospfv2': {}, 'ospfv3': {}, 'isis': {}, 'bgp-ls': {}, 'system-processed': {}, 'other': {}},), is_leaf=True, yang_name="information-source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-info-source', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """information_source must be of a type compatible with te-info-source""", + 'defined-type': "ietf-te-topology:te-info-source", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'unknown': {}, 'locally-configured': {}, 'ospfv2': {}, 'ospfv3': {}, 'isis': {}, 'bgp-ls': {}, 'system-processed': {}, 'other': {}},), is_leaf=True, yang_name="information-source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-info-source', is_config=False)""", + }) + + self.__information_source = t + if hasattr(self, '_set'): + self._set() + + def _unset_information_source(self): + self.__information_source = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'unknown': {}, 'locally-configured': {}, 'ospfv2': {}, 'ospfv3': {}, 'isis': {}, 'bgp-ls': {}, 'system-processed': {}, 'other': {}},), is_leaf=True, yang_name="information-source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-info-source', is_config=False) + + + def _get_information_source_instance(self): + """ + Getter method for information_source_instance, mapped from YANG variable /networks/network/link/te/information_source_entry/information_source_instance (string) + + YANG Description: The name indicating the instance of the information +source. + """ + return self.__information_source_instance + + def _set_information_source_instance(self, v, load=False): + """ + Setter method for information_source_instance, mapped from YANG variable /networks/network/link/te/information_source_entry/information_source_instance (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_information_source_instance is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_information_source_instance() directly. + + YANG Description: The name indicating the instance of the information +source. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="information-source-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """information_source_instance must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="information-source-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__information_source_instance = t + if hasattr(self, '_set'): + self._set() + + def _unset_information_source_instance(self): + self.__information_source_instance = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="information-source-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + + def _get_information_source_state(self): + """ + Getter method for information_source_state, mapped from YANG variable /networks/network/link/te/information_source_entry/information_source_state (container) + + YANG Description: Contains state attributes related to the information +source. + """ + return self.__information_source_state + + def _set_information_source_state(self, v, load=False): + """ + Setter method for information_source_state, mapped from YANG variable /networks/network/link/te/information_source_entry/information_source_state (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_information_source_state is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_information_source_state() directly. + + YANG Description: Contains state attributes related to the information +source. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=information_source_state.information_source_state, is_container='container', yang_name="information-source-state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """information_source_state must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=information_source_state.information_source_state, is_container='container', yang_name="information-source-state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__information_source_state = t + if hasattr(self, '_set'): + self._set() + + def _unset_information_source_state(self): + self.__information_source_state = YANGDynClass(base=information_source_state.information_source_state, is_container='container', yang_name="information-source-state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_link_index(self): + """ + Getter method for link_index, mapped from YANG variable /networks/network/link/te/information_source_entry/link_index (uint64) + + YANG Description: The link identifier. If OSPF is used, this object +represents an ospfLsdbID. If IS-IS is used, this object +represents an isisLSPID. If a locally configured link is +used, this object represents a unique value, which is +locally defined in a router. + """ + return self.__link_index + + def _set_link_index(self, v, load=False): + """ + Setter method for link_index, mapped from YANG variable /networks/network/link/te/information_source_entry/link_index (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_index() directly. + + YANG Description: The link identifier. If OSPF is used, this object +represents an ospfLsdbID. If IS-IS is used, this object +represents an isisLSPID. If a locally configured link is +used, this object represents a unique value, which is +locally defined in a router. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="link-index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_index must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="link-index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False)""", + }) + + self.__link_index = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_index(self): + self.__link_index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="link-index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + + + def _get_administrative_group(self): + """ + Getter method for administrative_group, mapped from YANG variable /networks/network/link/te/information_source_entry/administrative_group (te-types:admin-groups) + + YANG Description: Administrative group or color of the link. +This attribute covers both administrative groups (defined +in RFCs 3630 and 5305) and Extended Administrative Groups +(defined in RFC 7308). + """ + return self.__administrative_group + + def _set_administrative_group(self, v, load=False): + """ + Setter method for administrative_group, mapped from YANG variable /networks/network/link/te/information_source_entry/administrative_group (te-types:admin-groups) + If this variable is read-only (config: false) in the + source YANG file, then _set_administrative_group is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_administrative_group() directly. + + YANG Description: Administrative group or color of the link. +This attribute covers both administrative groups (defined +in RFCs 3630 and 5305) and Extended Administrative Groups +(defined in RFC 7308). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], is_leaf=True, yang_name="administrative-group", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:admin-groups', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """administrative_group must be of a type compatible with te-types:admin-groups""", + 'defined-type': "te-types:admin-groups", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], is_leaf=True, yang_name="administrative-group", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:admin-groups', is_config=False)""", + }) + + self.__administrative_group = t + if hasattr(self, '_set'): + self._set() + + def _unset_administrative_group(self): + self.__administrative_group = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], is_leaf=True, yang_name="administrative-group", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:admin-groups', is_config=False) + + + def _get_interface_switching_capability(self): + """ + Getter method for interface_switching_capability, mapped from YANG variable /networks/network/link/te/information_source_entry/interface_switching_capability (list) + + YANG Description: List of ISCDs for this link. + """ + return self.__interface_switching_capability + + def _set_interface_switching_capability(self, v, load=False): + """ + Setter method for interface_switching_capability, mapped from YANG variable /networks/network/link/te/information_source_entry/interface_switching_capability (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_interface_switching_capability is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_interface_switching_capability() directly. + + YANG Description: List of ISCDs for this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("switching_capability encoding",interface_switching_capability.interface_switching_capability, yang_name="interface-switching-capability", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='switching-capability encoding', extensions=None), is_container='list', yang_name="interface-switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """interface_switching_capability must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("switching_capability encoding",interface_switching_capability.interface_switching_capability, yang_name="interface-switching-capability", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='switching-capability encoding', extensions=None), is_container='list', yang_name="interface-switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__interface_switching_capability = t + if hasattr(self, '_set'): + self._set() + + def _unset_interface_switching_capability(self): + self.__interface_switching_capability = YANGDynClass(base=YANGListType("switching_capability encoding",interface_switching_capability.interface_switching_capability, yang_name="interface-switching-capability", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='switching-capability encoding', extensions=None), is_container='list', yang_name="interface-switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + + def _get_label_restrictions(self): + """ + Getter method for label_restrictions, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions (container) + + YANG Description: The label restrictions container. + """ + return self.__label_restrictions + + def _set_label_restrictions(self, v, load=False): + """ + Setter method for label_restrictions, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_restrictions is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_restrictions() directly. + + YANG Description: The label restrictions container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_restrictions must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_restrictions = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_restrictions(self): + self.__label_restrictions = YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_link_protection_type(self): + """ + Getter method for link_protection_type, mapped from YANG variable /networks/network/link/te/information_source_entry/link_protection_type (identityref) + + YANG Description: Link Protection Type desired for this link. + """ + return self.__link_protection_type + + def _set_link_protection_type(self, v, load=False): + """ + Setter method for link_protection_type, mapped from YANG variable /networks/network/link/te/information_source_entry/link_protection_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_protection_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_protection_type() directly. + + YANG Description: Link Protection Type desired for this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="link-protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_protection_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="link-protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__link_protection_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_protection_type(self): + self.__link_protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="link-protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_max_link_bandwidth(self): + """ + Getter method for max_link_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/max_link_bandwidth (container) + + YANG Description: Maximum bandwidth that can be seen on this link in this +direction. Units are in bytes per second. + """ + return self.__max_link_bandwidth + + def _set_max_link_bandwidth(self, v, load=False): + """ + Setter method for max_link_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/max_link_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_max_link_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_max_link_bandwidth() directly. + + YANG Description: Maximum bandwidth that can be seen on this link in this +direction. Units are in bytes per second. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=max_link_bandwidth.max_link_bandwidth, is_container='container', yang_name="max-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """max_link_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=max_link_bandwidth.max_link_bandwidth, is_container='container', yang_name="max-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__max_link_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_max_link_bandwidth(self): + self.__max_link_bandwidth = YANGDynClass(base=max_link_bandwidth.max_link_bandwidth, is_container='container', yang_name="max-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_max_resv_link_bandwidth(self): + """ + Getter method for max_resv_link_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/max_resv_link_bandwidth (container) + + YANG Description: Maximum amount of bandwidth that can be reserved in this +direction in this link. Units are in bytes per second. + """ + return self.__max_resv_link_bandwidth + + def _set_max_resv_link_bandwidth(self, v, load=False): + """ + Setter method for max_resv_link_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/max_resv_link_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_max_resv_link_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_max_resv_link_bandwidth() directly. + + YANG Description: Maximum amount of bandwidth that can be reserved in this +direction in this link. Units are in bytes per second. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=max_resv_link_bandwidth.max_resv_link_bandwidth, is_container='container', yang_name="max-resv-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """max_resv_link_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=max_resv_link_bandwidth.max_resv_link_bandwidth, is_container='container', yang_name="max-resv-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__max_resv_link_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_max_resv_link_bandwidth(self): + self.__max_resv_link_bandwidth = YANGDynClass(base=max_resv_link_bandwidth.max_resv_link_bandwidth, is_container='container', yang_name="max-resv-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_unreserved_bandwidth(self): + """ + Getter method for unreserved_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/unreserved_bandwidth (list) + + YANG Description: Unreserved bandwidth for priority levels 0-7. Units are in +bytes per second. + """ + return self.__unreserved_bandwidth + + def _set_unreserved_bandwidth(self, v, load=False): + """ + Setter method for unreserved_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/unreserved_bandwidth (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_unreserved_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unreserved_bandwidth() directly. + + YANG Description: Unreserved bandwidth for priority levels 0-7. Units are in +bytes per second. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("priority",unreserved_bandwidth.unreserved_bandwidth, yang_name="unreserved-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="unreserved-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unreserved_bandwidth must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("priority",unreserved_bandwidth.unreserved_bandwidth, yang_name="unreserved-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="unreserved-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__unreserved_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_unreserved_bandwidth(self): + self.__unreserved_bandwidth = YANGDynClass(base=YANGListType("priority",unreserved_bandwidth.unreserved_bandwidth, yang_name="unreserved-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="unreserved-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + + def _get_te_default_metric(self): + """ + Getter method for te_default_metric, mapped from YANG variable /networks/network/link/te/information_source_entry/te_default_metric (uint32) + + YANG Description: Traffic Engineering metric. + """ + return self.__te_default_metric + + def _set_te_default_metric(self, v, load=False): + """ + Setter method for te_default_metric, mapped from YANG variable /networks/network/link/te/information_source_entry/te_default_metric (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_default_metric is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_default_metric() directly. + + YANG Description: Traffic Engineering metric. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-default-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_default_metric must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-default-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False)""", + }) + + self.__te_default_metric = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_default_metric(self): + self.__te_default_metric = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-default-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_te_delay_metric(self): + """ + Getter method for te_delay_metric, mapped from YANG variable /networks/network/link/te/information_source_entry/te_delay_metric (uint32) + + YANG Description: Traffic Engineering delay metric. + """ + return self.__te_delay_metric + + def _set_te_delay_metric(self, v, load=False): + """ + Setter method for te_delay_metric, mapped from YANG variable /networks/network/link/te/information_source_entry/te_delay_metric (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_delay_metric is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_delay_metric() directly. + + YANG Description: Traffic Engineering delay metric. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-delay-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_delay_metric must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-delay-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False)""", + }) + + self.__te_delay_metric = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_delay_metric(self): + self.__te_delay_metric = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-delay-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_te_igp_metric(self): + """ + Getter method for te_igp_metric, mapped from YANG variable /networks/network/link/te/information_source_entry/te_igp_metric (uint32) + + YANG Description: IGP metric used for Traffic Engineering. + """ + return self.__te_igp_metric + + def _set_te_igp_metric(self, v, load=False): + """ + Setter method for te_igp_metric, mapped from YANG variable /networks/network/link/te/information_source_entry/te_igp_metric (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_igp_metric is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_igp_metric() directly. + + YANG Description: IGP metric used for Traffic Engineering. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-igp-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_igp_metric must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-igp-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False)""", + }) + + self.__te_igp_metric = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_igp_metric(self): + self.__te_igp_metric = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-igp-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_te_srlgs(self): + """ + Getter method for te_srlgs, mapped from YANG variable /networks/network/link/te/information_source_entry/te_srlgs (container) + + YANG Description: Contains a list of SRLGs. + """ + return self.__te_srlgs + + def _set_te_srlgs(self, v, load=False): + """ + Setter method for te_srlgs, mapped from YANG variable /networks/network/link/te/information_source_entry/te_srlgs (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_srlgs is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_srlgs() directly. + + YANG Description: Contains a list of SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_srlgs.te_srlgs, is_container='container', yang_name="te-srlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_srlgs must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_srlgs.te_srlgs, is_container='container', yang_name="te-srlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_srlgs = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_srlgs(self): + self.__te_srlgs = YANGDynClass(base=te_srlgs.te_srlgs, is_container='container', yang_name="te-srlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_te_nsrlgs(self): + """ + Getter method for te_nsrlgs, mapped from YANG variable /networks/network/link/te/information_source_entry/te_nsrlgs (container) + + YANG Description: Contains a list of NSRLGs (Non-Shared Risk Link Groups). +When an abstract TE link is configured, this list specifies +the request that underlay TE paths need to be mutually +disjoint with other TE links in the same groups. + """ + return self.__te_nsrlgs + + def _set_te_nsrlgs(self, v, load=False): + """ + Setter method for te_nsrlgs, mapped from YANG variable /networks/network/link/te/information_source_entry/te_nsrlgs (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_nsrlgs is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_nsrlgs() directly. + + YANG Description: Contains a list of NSRLGs (Non-Shared Risk Link Groups). +When an abstract TE link is configured, this list specifies +the request that underlay TE paths need to be mutually +disjoint with other TE links in the same groups. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_nsrlgs.te_nsrlgs, is_container='container', yang_name="te-nsrlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_nsrlgs must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_nsrlgs.te_nsrlgs, is_container='container', yang_name="te-nsrlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_nsrlgs = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_nsrlgs(self): + self.__te_nsrlgs = YANGDynClass(base=te_nsrlgs.te_nsrlgs, is_container='container', yang_name="te-nsrlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + information_source = __builtin__.property(_get_information_source) + information_source_instance = __builtin__.property(_get_information_source_instance) + information_source_state = __builtin__.property(_get_information_source_state) + link_index = __builtin__.property(_get_link_index) + administrative_group = __builtin__.property(_get_administrative_group) + interface_switching_capability = __builtin__.property(_get_interface_switching_capability) + label_restrictions = __builtin__.property(_get_label_restrictions) + link_protection_type = __builtin__.property(_get_link_protection_type) + max_link_bandwidth = __builtin__.property(_get_max_link_bandwidth) + max_resv_link_bandwidth = __builtin__.property(_get_max_resv_link_bandwidth) + unreserved_bandwidth = __builtin__.property(_get_unreserved_bandwidth) + te_default_metric = __builtin__.property(_get_te_default_metric) + te_delay_metric = __builtin__.property(_get_te_delay_metric) + te_igp_metric = __builtin__.property(_get_te_igp_metric) + te_srlgs = __builtin__.property(_get_te_srlgs) + te_nsrlgs = __builtin__.property(_get_te_nsrlgs) + + + _pyangbind_elements = OrderedDict([('information_source', information_source), ('information_source_instance', information_source_instance), ('information_source_state', information_source_state), ('link_index', link_index), ('administrative_group', administrative_group), ('interface_switching_capability', interface_switching_capability), ('label_restrictions', label_restrictions), ('link_protection_type', link_protection_type), ('max_link_bandwidth', max_link_bandwidth), ('max_resv_link_bandwidth', max_resv_link_bandwidth), ('unreserved_bandwidth', unreserved_bandwidth), ('te_default_metric', te_default_metric), ('te_delay_metric', te_delay_metric), ('te_igp_metric', te_igp_metric), ('te_srlgs', te_srlgs), ('te_nsrlgs', te_nsrlgs), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/information_source_state/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/information_source_state/__init__.py new file mode 100644 index 000000000..51885bb49 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/information_source_state/__init__.py @@ -0,0 +1,248 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import topology +class information_source_state(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/information-source-state. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains state attributes related to the information +source. + """ + __slots__ = ('_path_helper', '_extmethods', '__credibility_preference','__logical_network_element','__network_instance','__topology',) + + _yang_name = 'information-source-state' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__credibility_preference = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="credibility-preference", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=False) + self.__logical_network_element = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="logical-network-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + self.__network_instance = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + self.__topology = YANGDynClass(base=topology.topology, is_container='container', yang_name="topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'information-source-entry', 'information-source-state'] + + def _get_credibility_preference(self): + """ + Getter method for credibility_preference, mapped from YANG variable /networks/network/link/te/information_source_entry/information_source_state/credibility_preference (uint16) + + YANG Description: The preference value for calculating the Traffic +Engineering database credibility value used for +tie-break selection between different information-source +values. A higher value is preferable. + """ + return self.__credibility_preference + + def _set_credibility_preference(self, v, load=False): + """ + Setter method for credibility_preference, mapped from YANG variable /networks/network/link/te/information_source_entry/information_source_state/credibility_preference (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_credibility_preference is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_credibility_preference() directly. + + YANG Description: The preference value for calculating the Traffic +Engineering database credibility value used for +tie-break selection between different information-source +values. A higher value is preferable. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="credibility-preference", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """credibility_preference must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="credibility-preference", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=False)""", + }) + + self.__credibility_preference = t + if hasattr(self, '_set'): + self._set() + + def _unset_credibility_preference(self): + self.__credibility_preference = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="credibility-preference", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=False) + + + def _get_logical_network_element(self): + """ + Getter method for logical_network_element, mapped from YANG variable /networks/network/link/te/information_source_entry/information_source_state/logical_network_element (string) + + YANG Description: When applicable, this is the name of a logical network +element from which the information is learned. + """ + return self.__logical_network_element + + def _set_logical_network_element(self, v, load=False): + """ + Setter method for logical_network_element, mapped from YANG variable /networks/network/link/te/information_source_entry/information_source_state/logical_network_element (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_logical_network_element is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_logical_network_element() directly. + + YANG Description: When applicable, this is the name of a logical network +element from which the information is learned. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="logical-network-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """logical_network_element must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="logical-network-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__logical_network_element = t + if hasattr(self, '_set'): + self._set() + + def _unset_logical_network_element(self): + self.__logical_network_element = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="logical-network-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + + def _get_network_instance(self): + """ + Getter method for network_instance, mapped from YANG variable /networks/network/link/te/information_source_entry/information_source_state/network_instance (string) + + YANG Description: When applicable, this is the name of a network instance +from which the information is learned. + """ + return self.__network_instance + + def _set_network_instance(self, v, load=False): + """ + Setter method for network_instance, mapped from YANG variable /networks/network/link/te/information_source_entry/information_source_state/network_instance (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_instance is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_instance() directly. + + YANG Description: When applicable, this is the name of a network instance +from which the information is learned. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_instance must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__network_instance = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_instance(self): + self.__network_instance = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + + def _get_topology(self): + """ + Getter method for topology, mapped from YANG variable /networks/network/link/te/information_source_entry/information_source_state/topology (container) + + YANG Description: When the information is processed by the system, +the attributes in this container indicate which topology +is used to generate the result information. + """ + return self.__topology + + def _set_topology(self, v, load=False): + """ + Setter method for topology, mapped from YANG variable /networks/network/link/te/information_source_entry/information_source_state/topology (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_topology is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_topology() directly. + + YANG Description: When the information is processed by the system, +the attributes in this container indicate which topology +is used to generate the result information. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=topology.topology, is_container='container', yang_name="topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """topology must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=topology.topology, is_container='container', yang_name="topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__topology = t + if hasattr(self, '_set'): + self._set() + + def _unset_topology(self): + self.__topology = YANGDynClass(base=topology.topology, is_container='container', yang_name="topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + credibility_preference = __builtin__.property(_get_credibility_preference) + logical_network_element = __builtin__.property(_get_logical_network_element) + network_instance = __builtin__.property(_get_network_instance) + topology = __builtin__.property(_get_topology) + + + _pyangbind_elements = OrderedDict([('credibility_preference', credibility_preference), ('logical_network_element', logical_network_element), ('network_instance', network_instance), ('topology', topology), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/information_source_state/topology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/information_source_state/topology/__init__.py new file mode 100644 index 000000000..0c611a8e1 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/information_source_state/topology/__init__.py @@ -0,0 +1,162 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class topology(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/information-source-state/topology. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: When the information is processed by the system, +the attributes in this container indicate which topology +is used to generate the result information. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_ref','__network_ref',) + + _yang_name = 'topology' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="link-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'information-source-entry', 'information-source-state', 'topology'] + + def _get_link_ref(self): + """ + Getter method for link_ref, mapped from YANG variable /networks/network/link/te/information_source_entry/information_source_state/topology/link_ref (leafref) + + YANG Description: A type for an absolute reference to a link instance. +(This type should not be used for relative references. +In such a case, a relative path should be used instead.) + """ + return self.__link_ref + + def _set_link_ref(self, v, load=False): + """ + Setter method for link_ref, mapped from YANG variable /networks/network/link/te/information_source_entry/information_source_state/topology/link_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_ref() directly. + + YANG Description: A type for an absolute reference to a link instance. +(This type should not be used for relative references. +In such a case, a relative path should be used instead.) + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="link-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="link-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False)""", + }) + + self.__link_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_ref(self): + self.__link_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="link-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/link/te/information_source_entry/information_source_state/topology/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/link/te/information_source_entry/information_source_state/topology/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + + link_ref = __builtin__.property(_get_link_ref) + network_ref = __builtin__.property(_get_network_ref) + + + _pyangbind_elements = OrderedDict([('link_ref', link_ref), ('network_ref', network_ref), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/__init__.py new file mode 100644 index 000000000..55c5599b7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/__init__.py @@ -0,0 +1,206 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import max_lsp_bandwidth +class interface_switching_capability(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/interface-switching-capability. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of ISCDs for this link. + """ + __slots__ = ('_path_helper', '_extmethods', '__switching_capability','__encoding','__max_lsp_bandwidth',) + + _yang_name = 'interface-switching-capability' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__switching_capability = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__encoding = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__max_lsp_bandwidth = YANGDynClass(base=YANGListType("priority",max_lsp_bandwidth.max_lsp_bandwidth, yang_name="max-lsp-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="max-lsp-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'information-source-entry', 'interface-switching-capability'] + + def _get_switching_capability(self): + """ + Getter method for switching_capability, mapped from YANG variable /networks/network/link/te/information_source_entry/interface_switching_capability/switching_capability (identityref) + + YANG Description: Switching capability for this interface. + """ + return self.__switching_capability + + def _set_switching_capability(self, v, load=False): + """ + Setter method for switching_capability, mapped from YANG variable /networks/network/link/te/information_source_entry/interface_switching_capability/switching_capability (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_switching_capability is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_switching_capability() directly. + + YANG Description: Switching capability for this interface. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """switching_capability must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__switching_capability = t + if hasattr(self, '_set'): + self._set() + + def _unset_switching_capability(self): + self.__switching_capability = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_encoding(self): + """ + Getter method for encoding, mapped from YANG variable /networks/network/link/te/information_source_entry/interface_switching_capability/encoding (identityref) + + YANG Description: Encoding supported by this interface. + """ + return self.__encoding + + def _set_encoding(self, v, load=False): + """ + Setter method for encoding, mapped from YANG variable /networks/network/link/te/information_source_entry/interface_switching_capability/encoding (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_encoding is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_encoding() directly. + + YANG Description: Encoding supported by this interface. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """encoding must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__encoding = t + if hasattr(self, '_set'): + self._set() + + def _unset_encoding(self): + self.__encoding = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_max_lsp_bandwidth(self): + """ + Getter method for max_lsp_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth (list) + + YANG Description: Maximum Label Switched Path (LSP) bandwidth at +priorities 0-7. + """ + return self.__max_lsp_bandwidth + + def _set_max_lsp_bandwidth(self, v, load=False): + """ + Setter method for max_lsp_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_max_lsp_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_max_lsp_bandwidth() directly. + + YANG Description: Maximum Label Switched Path (LSP) bandwidth at +priorities 0-7. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("priority",max_lsp_bandwidth.max_lsp_bandwidth, yang_name="max-lsp-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="max-lsp-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """max_lsp_bandwidth must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("priority",max_lsp_bandwidth.max_lsp_bandwidth, yang_name="max-lsp-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="max-lsp-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__max_lsp_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_max_lsp_bandwidth(self): + self.__max_lsp_bandwidth = YANGDynClass(base=YANGListType("priority",max_lsp_bandwidth.max_lsp_bandwidth, yang_name="max-lsp-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="max-lsp-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + switching_capability = __builtin__.property(_get_switching_capability) + encoding = __builtin__.property(_get_encoding) + max_lsp_bandwidth = __builtin__.property(_get_max_lsp_bandwidth) + + + _pyangbind_elements = OrderedDict([('switching_capability', switching_capability), ('encoding', encoding), ('max_lsp_bandwidth', max_lsp_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/__init__.py new file mode 100644 index 000000000..752eac929 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/__init__.py @@ -0,0 +1,163 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_bandwidth +class max_lsp_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/interface-switching-capability/max-lsp-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Maximum Label Switched Path (LSP) bandwidth at +priorities 0-7. + """ + __slots__ = ('_path_helper', '_extmethods', '__priority','__te_bandwidth',) + + _yang_name = 'max-lsp-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'information-source-entry', 'interface-switching-capability', 'max-lsp-bandwidth'] + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/priority (uint8) + + YANG Description: Priority. + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: Priority. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + + + def _get_te_bandwidth(self): + """ + Getter method for te_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth (container) + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + return self.__te_bandwidth + + def _set_te_bandwidth(self, v, load=False): + """ + Setter method for te_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_bandwidth() directly. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_bandwidth(self): + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + priority = __builtin__.property(_get_priority) + te_bandwidth = __builtin__.property(_get_te_bandwidth) + + + _pyangbind_elements = OrderedDict([('priority', priority), ('te_bandwidth', te_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/__init__.py new file mode 100644 index 000000000..4daa8700c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/__init__.py @@ -0,0 +1,195 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/interface-switching-capability/max-lsp-bandwidth/te-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_bandwidth',) + + _yang_name = 'te-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'information-source-entry', 'interface-switching-capability', 'max-lsp-bandwidth', 'te-bandwidth'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/generic (te-bandwidth) + + YANG Description: Bandwidth specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/generic (te-bandwidth) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Bandwidth specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with te-bandwidth""", + 'defined-type': "ietf-te-topology:te-bandwidth", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn (container) + + YANG Description: Maximum bandwidth attributes for OTN paths. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Maximum bandwidth attributes for OTN paths. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_eth_bandwidth(self): + """ + Getter method for eth_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/eth_bandwidth (uint64) + + YANG Description: Available bandwith value expressed in kilobits per second + """ + return self.__eth_bandwidth + + def _set_eth_bandwidth(self, v, load=False): + """ + Setter method for eth_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/eth_bandwidth (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_bandwidth() directly. + + YANG Description: Available bandwith value expressed in kilobits per second + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_bandwidth must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=False)""", + }) + + self.__eth_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_bandwidth(self): + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + eth_bandwidth = __builtin__.property(_get_eth_bandwidth) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['eth_bandwidth']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_bandwidth', eth_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/__init__.py new file mode 100644 index 000000000..ad8f9372d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/__init__.py @@ -0,0 +1,156 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/interface-switching-capability/max-lsp-bandwidth/te-bandwidth/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Maximum bandwidth attributes for OTN paths. + """ + __slots__ = ('_path_helper', '_extmethods', '__odu_type','__max_ts_number',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__max_ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="max-ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'information-source-entry', 'interface-switching-capability', 'max-lsp-bandwidth', 'te-bandwidth', 'otn'] + + def _get_odu_type(self): + """ + Getter method for odu_type, mapped from YANG variable /networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/odu_type (identityref) + + YANG Description: ODU type + """ + return self.__odu_type + + def _set_odu_type(self, v, load=False): + """ + Setter method for odu_type, mapped from YANG variable /networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/odu_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type() directly. + + YANG Description: ODU type + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__odu_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type(self): + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_max_ts_number(self): + """ + Getter method for max_ts_number, mapped from YANG variable /networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/max_ts_number (uint16) + + YANG Description: The maximum number of Tributary Slots (TS) that could be +used by an ODUflex LSP. + """ + return self.__max_ts_number + + def _set_max_ts_number(self, v, load=False): + """ + Setter method for max_ts_number, mapped from YANG variable /networks/network/link/te/information_source_entry/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/max_ts_number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_max_ts_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_max_ts_number() directly. + + YANG Description: The maximum number of Tributary Slots (TS) that could be +used by an ODUflex LSP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="max-ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """max_ts_number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="max-ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False)""", + }) + + self.__max_ts_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_max_ts_number(self): + self.__max_ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="max-ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + + odu_type = __builtin__.property(_get_odu_type) + max_ts_number = __builtin__.property(_get_max_ts_number) + + __choices__ = {'technology': {'otn': ['odu_type', 'max_ts_number']}} + _pyangbind_elements = OrderedDict([('odu_type', odu_type), ('max_ts_number', max_ts_number), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/__init__.py new file mode 100644 index 000000000..47f225a47 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/__init__.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import label_restriction +class label_restrictions(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/label-restrictions. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The label restrictions container. + """ + __slots__ = ('_path_helper', '_extmethods', '__label_restriction',) + + _yang_name = 'label-restrictions' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__label_restriction = YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'information-source-entry', 'label-restrictions'] + + def _get_label_restriction(self): + """ + Getter method for label_restriction, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction (list) + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + return self.__label_restriction + + def _set_label_restriction(self, v, load=False): + """ + Setter method for label_restriction, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_restriction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_restriction() directly. + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_restriction must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__label_restriction = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_restriction(self): + self.__label_restriction = YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + label_restriction = __builtin__.property(_get_label_restriction) + + + _pyangbind_elements = OrderedDict([('label_restriction', label_restriction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/__init__.py new file mode 100644 index 000000000..c7ec9312d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/__init__.py @@ -0,0 +1,450 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import label_start +from . import label_end +from . import label_step +from . import otn_label_range +from . import ethernet_label_range +class label_restriction(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/label-restrictions/label-restriction. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + __slots__ = ('_path_helper', '_extmethods', '__restriction','__index','__label_start','__label_end','__label_step','__range_bitmap','__otn_label_range','__ethernet_label_range',) + + _yang_name = 'label-restriction' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__restriction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=False) + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__label_start = YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__label_end = YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__label_step = YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__range_bitmap = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=False) + self.__otn_label_range = YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__ethernet_label_range = YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'information-source-entry', 'label-restrictions', 'label-restriction'] + + def _get_restriction(self): + """ + Getter method for restriction, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/restriction (enumeration) + + YANG Description: Indicates whether the list item is inclusive or exclusive. + """ + return self.__restriction + + def _set_restriction(self, v, load=False): + """ + Setter method for restriction, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/restriction (enumeration) + If this variable is read-only (config: false) in the + source YANG file, then _set_restriction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_restriction() directly. + + YANG Description: Indicates whether the list item is inclusive or exclusive. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """restriction must be of a type compatible with enumeration""", + 'defined-type': "ietf-te-topology:enumeration", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=False)""", + }) + + self.__restriction = t + if hasattr(self, '_set'): + self._set() + + def _unset_restriction(self): + self.__restriction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=False) + + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/index (uint32) + + YANG Description: The index of the label restriction list entry. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/index (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: The index of the label restriction list entry. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_label_start(self): + """ + Getter method for label_start, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start (container) + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + return self.__label_start + + def _set_label_start(self, v, load=False): + """ + Setter method for label_start, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_start is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_start() directly. + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_start must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_start = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_start(self): + self.__label_start = YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_label_end(self): + """ + Getter method for label_end, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end (container) + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + return self.__label_end + + def _set_label_end(self, v, load=False): + """ + Setter method for label_end, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_end is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_end() directly. + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_end must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_end = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_end(self): + self.__label_end = YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_label_step(self): + """ + Getter method for label_step, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step (container) + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + return self.__label_step + + def _set_label_step(self, v, load=False): + """ + Setter method for label_step, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_step is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_step() directly. + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_step must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_step = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_step(self): + self.__label_step = YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_range_bitmap(self): + """ + Getter method for range_bitmap, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/range_bitmap (yang:hex-string) + + YANG Description: When there are gaps between 'label-start' and 'label-end', +this attribute is used to specify the positions +of the used labels. This is represented in big endian as +'hex-string'. +The most significant byte in the hex-string is the farthest +to the left in the byte sequence. Leading zero bytes in the +configured value may be omitted for brevity. +Each bit position in the 'range-bitmap' 'hex-string' maps +to a label in the range derived from 'label-start'. + +For example, assuming that 'label-start' = 16000 and +'range-bitmap' = 0x01000001, then: + +- bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. +- bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1. + """ + return self.__range_bitmap + + def _set_range_bitmap(self, v, load=False): + """ + Setter method for range_bitmap, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/range_bitmap (yang:hex-string) + If this variable is read-only (config: false) in the + source YANG file, then _set_range_bitmap is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_range_bitmap() directly. + + YANG Description: When there are gaps between 'label-start' and 'label-end', +this attribute is used to specify the positions +of the used labels. This is represented in big endian as +'hex-string'. +The most significant byte in the hex-string is the farthest +to the left in the byte sequence. Leading zero bytes in the +configured value may be omitted for brevity. +Each bit position in the 'range-bitmap' 'hex-string' maps +to a label in the range derived from 'label-start'. + +For example, assuming that 'label-start' = 16000 and +'range-bitmap' = 0x01000001, then: + +- bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. +- bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """range_bitmap must be of a type compatible with yang:hex-string""", + 'defined-type': "yang:hex-string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=False)""", + }) + + self.__range_bitmap = t + if hasattr(self, '_set'): + self._set() + + def _unset_range_bitmap(self): + self.__range_bitmap = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=False) + + + def _get_otn_label_range(self): + """ + Getter method for otn_label_range, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/otn_label_range (container) + + YANG Description: Label range information for OTN. + """ + return self.__otn_label_range + + def _set_otn_label_range(self, v, load=False): + """ + Setter method for otn_label_range, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/otn_label_range (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn_label_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn_label_range() directly. + + YANG Description: Label range information for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn_label_range must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn_label_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn_label_range(self): + self.__otn_label_range = YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_ethernet_label_range(self): + """ + Getter method for ethernet_label_range, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/ethernet_label_range (container) + + YANG Description: Ethernet-specific label range related information. + """ + return self.__ethernet_label_range + + def _set_ethernet_label_range(self, v, load=False): + """ + Setter method for ethernet_label_range, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/ethernet_label_range (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_ethernet_label_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ethernet_label_range() directly. + + YANG Description: Ethernet-specific label range related information. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ethernet_label_range must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=False)""", + }) + + self.__ethernet_label_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_ethernet_label_range(self): + self.__ethernet_label_range = YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=False) + + restriction = __builtin__.property(_get_restriction) + index = __builtin__.property(_get_index) + label_start = __builtin__.property(_get_label_start) + label_end = __builtin__.property(_get_label_end) + label_step = __builtin__.property(_get_label_step) + range_bitmap = __builtin__.property(_get_range_bitmap) + otn_label_range = __builtin__.property(_get_otn_label_range) + ethernet_label_range = __builtin__.property(_get_ethernet_label_range) + + + _pyangbind_elements = OrderedDict([('restriction', restriction), ('index', index), ('label_start', label_start), ('label_end', label_end), ('label_step', label_step), ('range_bitmap', range_bitmap), ('otn_label_range', otn_label_range), ('ethernet_label_range', ethernet_label_range), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/ethernet_label_range/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/ethernet_label_range/__init__.py new file mode 100644 index 000000000..24ee2d6c9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/ethernet_label_range/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class ethernet_label_range(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/label-restrictions/label-restriction/ethernet-label-range. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Ethernet-specific label range related information. + """ + __slots__ = ('_path_helper', '_extmethods', '__tag_type','__priority',) + + _yang_name = 'ethernet-label-range' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tag_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=False) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'information-source-entry', 'label-restrictions', 'label-restriction', 'ethernet-label-range'] + + def _get_tag_type(self): + """ + Getter method for tag_type, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/ethernet_label_range/tag_type (etht-types:eth-tag-type) + + YANG Description: VLAN tag type. + """ + return self.__tag_type + + def _set_tag_type(self, v, load=False): + """ + Setter method for tag_type, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/ethernet_label_range/tag_type (etht-types:eth-tag-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_tag_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tag_type() directly. + + YANG Description: VLAN tag type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tag_type must be of a type compatible with etht-types:eth-tag-type""", + 'defined-type': "etht-types:eth-tag-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=False)""", + }) + + self.__tag_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_tag_type(self): + self.__tag_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=False) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/ethernet_label_range/priority (uint8) + + YANG Description: priority. + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/ethernet_label_range/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: priority. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=False)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=False) + + tag_type = __builtin__.property(_get_tag_type) + priority = __builtin__.property(_get_priority) + + + _pyangbind_elements = OrderedDict([('tag_type', tag_type), ('priority', priority), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/__init__.py new file mode 100644 index 000000000..105618cf9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/__init__.py @@ -0,0 +1,119 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_end(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/label-restrictions/label-restriction/label-end. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-end' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'information-source-entry', 'label-restrictions', 'label-restriction', 'label-end'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_label = __builtin__.property(_get_te_label) + + + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/__init__.py new file mode 100644 index 000000000..696280486 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/label-restrictions/label-restriction/label-end/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'information-source-entry', 'label-restrictions', 'label-restriction', 'label-end', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/otn (container) + + YANG Description: Label start or label end for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label start or label end for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + vlanid = __builtin__.property(_get_vlanid) + direction = __builtin__.property(_get_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py new file mode 100644 index 000000000..7e552cd7f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/label-restrictions/label-restriction/label-end/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label start or label end for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'information-source-entry', 'label-restrictions', 'label-restriction', 'label-end', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/otn/ts (otn-ts) + + YANG Description: Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_end/te_label/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + + tpn = __builtin__.property(_get_tpn) + ts = __builtin__.property(_get_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/__init__.py new file mode 100644 index 000000000..06a33be37 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/__init__.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_start(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/label-restrictions/label-restriction/label-start. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-start' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'information-source-entry', 'label-restrictions', 'label-restriction', 'label-start'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_label = __builtin__.property(_get_te_label) + + + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/__init__.py new file mode 100644 index 000000000..1d3235b98 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/label-restrictions/label-restriction/label-start/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'information-source-entry', 'label-restrictions', 'label-restriction', 'label-start', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/otn (container) + + YANG Description: Label start or label end for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label start or label end for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + vlanid = __builtin__.property(_get_vlanid) + direction = __builtin__.property(_get_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py new file mode 100644 index 000000000..4a9eb242f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/label-restrictions/label-restriction/label-start/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label start or label end for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'information-source-entry', 'label-restrictions', 'label-restriction', 'label-start', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/otn/ts (otn-ts) + + YANG Description: Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_start/te_label/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + + tpn = __builtin__.property(_get_tpn) + ts = __builtin__.property(_get_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/__init__.py new file mode 100644 index 000000000..e7fa272ea --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/__init__.py @@ -0,0 +1,200 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class label_step(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/label-restrictions/label-restriction/label-step. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_step',) + + _yang_name = 'label-step' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__eth_step = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'information-source-entry', 'label-restrictions', 'label-restriction', 'label-step'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/generic (int32) + + YANG Description: Label range step. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/generic (int32) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Label range step. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with int32""", + 'defined-type': "int32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/otn (container) + + YANG Description: Label step for OTN + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label step for OTN + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_eth_step(self): + """ + Getter method for eth_step, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/eth_step (uint16) + + YANG Description: Label step which represent possible increments for +an Ethernet VLAN tag. + """ + return self.__eth_step + + def _set_eth_step(self, v, load=False): + """ + Setter method for eth_step, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/eth_step (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_step is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_step() directly. + + YANG Description: Label step which represent possible increments for +an Ethernet VLAN tag. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_step must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=False)""", + }) + + self.__eth_step = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_step(self): + self.__eth_step = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + eth_step = __builtin__.property(_get_eth_step) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['eth_step']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_step', eth_step), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/otn/__init__.py new file mode 100644 index 000000000..335aed796 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/otn/__init__.py @@ -0,0 +1,158 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/label-restrictions/label-restriction/label-step/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label step for OTN + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'information-source-entry', 'label-restrictions', 'label-restriction', 'label-step', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/otn/tpn (otn-tpn) + + YANG Description: Label step which represents possible increments for +Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Label step which represents possible increments for +Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/otn/ts (otn-ts) + + YANG Description: Label step which represents possible increments for +Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/label_step/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Label step which represents possible increments for +Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + + tpn = __builtin__.property(_get_tpn) + ts = __builtin__.property(_get_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/otn_label_range/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/otn_label_range/__init__.py new file mode 100644 index 000000000..0c3ff7aaa --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/label_restrictions/label_restriction/otn_label_range/__init__.py @@ -0,0 +1,256 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn_label_range(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/label-restrictions/label-restriction/otn-label-range. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label range information for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__range_type','__tsg','__odu_type_list','__priority',) + + _yang_name = 'otn-label-range' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__range_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=False) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__odu_type_list = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'information-source-entry', 'label-restrictions', 'label-restriction', 'otn-label-range'] + + def _get_range_type(self): + """ + Getter method for range_type, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/otn_label_range/range_type (otn-label-range-type) + + YANG Description: The type of range (e.g., TPN or TS) +to which the label range applies + """ + return self.__range_type + + def _set_range_type(self, v, load=False): + """ + Setter method for range_type, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/otn_label_range/range_type (otn-label-range-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_range_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_range_type() directly. + + YANG Description: The type of range (e.g., TPN or TS) +to which the label range applies + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """range_type must be of a type compatible with otn-label-range-type""", + 'defined-type': "ietf-otn-topology:otn-label-range-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=False)""", + }) + + self.__range_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_range_type(self): + self.__range_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=False) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/otn_label_range/tsg (identityref) + + YANG Description: Tributary slot granularity (TSG) to which the label range +applies. + +This leaf MUST be present when the range-type is TS. + +This leaf MAY be omitted when mapping an ODUk over an OTUk +Link. In this case the range-type is tpn, with only one +entry (ODUk), and the tpn range has only one value (1). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/otn_label_range/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary slot granularity (TSG) to which the label range +applies. + +This leaf MUST be present when the range-type is TS. + +This leaf MAY be omitted when mapping an ODUk over an OTUk +Link. In this case the range-type is tpn, with only one +entry (ODUk), and the tpn range has only one value (1). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_odu_type_list(self): + """ + Getter method for odu_type_list, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/otn_label_range/odu_type_list (identityref) + + YANG Description: List of ODU types to which the label range applies. + +An Empty odu-type-list means that the label range +applies to all the supported ODU types. + """ + return self.__odu_type_list + + def _set_odu_type_list(self, v, load=False): + """ + Setter method for odu_type_list, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/otn_label_range/odu_type_list (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type_list() directly. + + YANG Description: List of ODU types to which the label range applies. + +An Empty odu-type-list means that the label range +applies to all the supported ODU types. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type_list must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__odu_type_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type_list(self): + self.__odu_type_list = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/otn_label_range/priority (uint8) + + YANG Description: Priority in Interface Switching Capability +Descriptor (ISCD). + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/link/te/information_source_entry/label_restrictions/label_restriction/otn_label_range/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: Priority in Interface Switching Capability +Descriptor (ISCD). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=False)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=False) + + range_type = __builtin__.property(_get_range_type) + tsg = __builtin__.property(_get_tsg) + odu_type_list = __builtin__.property(_get_odu_type_list) + priority = __builtin__.property(_get_priority) + + + _pyangbind_elements = OrderedDict([('range_type', range_type), ('tsg', tsg), ('odu_type_list', odu_type_list), ('priority', priority), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_link_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_link_bandwidth/__init__.py new file mode 100644 index 000000000..cfa184bcb --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_link_bandwidth/__init__.py @@ -0,0 +1,119 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_bandwidth +class max_link_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/max-link-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Maximum bandwidth that can be seen on this link in this +direction. Units are in bytes per second. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_bandwidth',) + + _yang_name = 'max-link-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'information-source-entry', 'max-link-bandwidth'] + + def _get_te_bandwidth(self): + """ + Getter method for te_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth (container) + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + return self.__te_bandwidth + + def _set_te_bandwidth(self, v, load=False): + """ + Setter method for te_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_bandwidth() directly. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_bandwidth(self): + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_bandwidth = __builtin__.property(_get_te_bandwidth) + + + _pyangbind_elements = OrderedDict([('te_bandwidth', te_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/__init__.py new file mode 100644 index 000000000..26e64557c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/__init__.py @@ -0,0 +1,195 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/max-link-bandwidth/te-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_bandwidth',) + + _yang_name = 'te-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'information-source-entry', 'max-link-bandwidth', 'te-bandwidth'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/generic (te-bandwidth) + + YANG Description: Bandwidth specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/generic (te-bandwidth) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Bandwidth specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with te-bandwidth""", + 'defined-type': "ietf-te-topology:te-bandwidth", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/otn (container) + + YANG Description: Bandwidth attributes for OTN links + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Bandwidth attributes for OTN links + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_eth_bandwidth(self): + """ + Getter method for eth_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/eth_bandwidth (uint64) + + YANG Description: Available bandwith value expressed in kilobits per second + """ + return self.__eth_bandwidth + + def _set_eth_bandwidth(self, v, load=False): + """ + Setter method for eth_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/eth_bandwidth (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_bandwidth() directly. + + YANG Description: Available bandwith value expressed in kilobits per second + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_bandwidth must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=False)""", + }) + + self.__eth_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_bandwidth(self): + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + eth_bandwidth = __builtin__.property(_get_eth_bandwidth) + + __choices__ = {'technology': {'generic': ['generic']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_bandwidth', eth_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/otn/__init__.py new file mode 100644 index 000000000..ff7bba04a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/otn/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import odulist +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/max-link-bandwidth/te-bandwidth/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Bandwidth attributes for OTN links + """ + __slots__ = ('_path_helper', '_extmethods', '__odulist',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'information-source-entry', 'max-link-bandwidth', 'te-bandwidth', 'otn'] + + def _get_odulist(self): + """ + Getter method for odulist, mapped from YANG variable /networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/otn/odulist (list) + + YANG Description: OTN bandwidth definition + """ + return self.__odulist + + def _set_odulist(self, v, load=False): + """ + Setter method for odulist, mapped from YANG variable /networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/otn/odulist (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_odulist is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odulist() directly. + + YANG Description: OTN bandwidth definition + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odulist must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=False)""", + }) + + self.__odulist = t + if hasattr(self, '_set'): + self._set() + + def _unset_odulist(self): + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=False) + + odulist = __builtin__.property(_get_odulist) + + + _pyangbind_elements = OrderedDict([('odulist', odulist), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/otn/odulist/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/otn/odulist/__init__.py new file mode 100644 index 000000000..544fbbda7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/otn/odulist/__init__.py @@ -0,0 +1,200 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class odulist(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/max-link-bandwidth/te-bandwidth/otn/odulist. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: OTN bandwidth definition + """ + __slots__ = ('_path_helper', '_extmethods', '__odu_type','__number','__ts_number',) + + _yang_name = 'odulist' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'information-source-entry', 'max-link-bandwidth', 'te-bandwidth', 'otn', 'odulist'] + + def _get_odu_type(self): + """ + Getter method for odu_type, mapped from YANG variable /networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/otn/odulist/odu_type (identityref) + + YANG Description: ODU type + """ + return self.__odu_type + + def _set_odu_type(self, v, load=False): + """ + Setter method for odu_type, mapped from YANG variable /networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/otn/odulist/odu_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type() directly. + + YANG Description: ODU type + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__odu_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type(self): + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_number(self): + """ + Getter method for number, mapped from YANG variable /networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/otn/odulist/number (uint16) + + YANG Description: Number of ODUs + """ + return self.__number + + def _set_number(self, v, load=False): + """ + Setter method for number, mapped from YANG variable /networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/otn/odulist/number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_number() directly. + + YANG Description: Number of ODUs + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False)""", + }) + + self.__number = t + if hasattr(self, '_set'): + self._set() + + def _unset_number(self): + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + + + def _get_ts_number(self): + """ + Getter method for ts_number, mapped from YANG variable /networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/otn/odulist/ts_number (uint16) + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + return self.__ts_number + + def _set_ts_number(self, v, load=False): + """ + Setter method for ts_number, mapped from YANG variable /networks/network/link/te/information_source_entry/max_link_bandwidth/te_bandwidth/otn/odulist/ts_number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_number() directly. + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False)""", + }) + + self.__ts_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_number(self): + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + + odu_type = __builtin__.property(_get_odu_type) + number = __builtin__.property(_get_number) + ts_number = __builtin__.property(_get_ts_number) + + + _pyangbind_elements = OrderedDict([('odu_type', odu_type), ('number', number), ('ts_number', ts_number), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_resv_link_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_resv_link_bandwidth/__init__.py new file mode 100644 index 000000000..08adf3f16 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_resv_link_bandwidth/__init__.py @@ -0,0 +1,119 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_bandwidth +class max_resv_link_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/max-resv-link-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Maximum amount of bandwidth that can be reserved in this +direction in this link. Units are in bytes per second. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_bandwidth',) + + _yang_name = 'max-resv-link-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'information-source-entry', 'max-resv-link-bandwidth'] + + def _get_te_bandwidth(self): + """ + Getter method for te_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth (container) + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + return self.__te_bandwidth + + def _set_te_bandwidth(self, v, load=False): + """ + Setter method for te_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_bandwidth() directly. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_bandwidth(self): + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_bandwidth = __builtin__.property(_get_te_bandwidth) + + + _pyangbind_elements = OrderedDict([('te_bandwidth', te_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/__init__.py new file mode 100644 index 000000000..bf441d72d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/__init__.py @@ -0,0 +1,195 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/max-resv-link-bandwidth/te-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_bandwidth',) + + _yang_name = 'te-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'information-source-entry', 'max-resv-link-bandwidth', 'te-bandwidth'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/generic (te-bandwidth) + + YANG Description: Bandwidth specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/generic (te-bandwidth) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Bandwidth specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with te-bandwidth""", + 'defined-type': "ietf-te-topology:te-bandwidth", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/otn (container) + + YANG Description: Bandwidth attributes for OTN links + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Bandwidth attributes for OTN links + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_eth_bandwidth(self): + """ + Getter method for eth_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/eth_bandwidth (uint64) + + YANG Description: Available bandwith value expressed in kilobits per second + """ + return self.__eth_bandwidth + + def _set_eth_bandwidth(self, v, load=False): + """ + Setter method for eth_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/eth_bandwidth (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_bandwidth() directly. + + YANG Description: Available bandwith value expressed in kilobits per second + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_bandwidth must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=False)""", + }) + + self.__eth_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_bandwidth(self): + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + eth_bandwidth = __builtin__.property(_get_eth_bandwidth) + + __choices__ = {'technology': {'generic': ['generic']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_bandwidth', eth_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/otn/__init__.py new file mode 100644 index 000000000..1e7147727 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/otn/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import odulist +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/max-resv-link-bandwidth/te-bandwidth/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Bandwidth attributes for OTN links + """ + __slots__ = ('_path_helper', '_extmethods', '__odulist',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'information-source-entry', 'max-resv-link-bandwidth', 'te-bandwidth', 'otn'] + + def _get_odulist(self): + """ + Getter method for odulist, mapped from YANG variable /networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/otn/odulist (list) + + YANG Description: OTN bandwidth definition + """ + return self.__odulist + + def _set_odulist(self, v, load=False): + """ + Setter method for odulist, mapped from YANG variable /networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/otn/odulist (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_odulist is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odulist() directly. + + YANG Description: OTN bandwidth definition + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odulist must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=False)""", + }) + + self.__odulist = t + if hasattr(self, '_set'): + self._set() + + def _unset_odulist(self): + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=False) + + odulist = __builtin__.property(_get_odulist) + + + _pyangbind_elements = OrderedDict([('odulist', odulist), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/otn/odulist/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/otn/odulist/__init__.py new file mode 100644 index 000000000..aff2126e7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/otn/odulist/__init__.py @@ -0,0 +1,200 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class odulist(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/max-resv-link-bandwidth/te-bandwidth/otn/odulist. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: OTN bandwidth definition + """ + __slots__ = ('_path_helper', '_extmethods', '__odu_type','__number','__ts_number',) + + _yang_name = 'odulist' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'information-source-entry', 'max-resv-link-bandwidth', 'te-bandwidth', 'otn', 'odulist'] + + def _get_odu_type(self): + """ + Getter method for odu_type, mapped from YANG variable /networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/otn/odulist/odu_type (identityref) + + YANG Description: ODU type + """ + return self.__odu_type + + def _set_odu_type(self, v, load=False): + """ + Setter method for odu_type, mapped from YANG variable /networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/otn/odulist/odu_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type() directly. + + YANG Description: ODU type + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__odu_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type(self): + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_number(self): + """ + Getter method for number, mapped from YANG variable /networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/otn/odulist/number (uint16) + + YANG Description: Number of ODUs + """ + return self.__number + + def _set_number(self, v, load=False): + """ + Setter method for number, mapped from YANG variable /networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/otn/odulist/number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_number() directly. + + YANG Description: Number of ODUs + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False)""", + }) + + self.__number = t + if hasattr(self, '_set'): + self._set() + + def _unset_number(self): + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + + + def _get_ts_number(self): + """ + Getter method for ts_number, mapped from YANG variable /networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/otn/odulist/ts_number (uint16) + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + return self.__ts_number + + def _set_ts_number(self, v, load=False): + """ + Setter method for ts_number, mapped from YANG variable /networks/network/link/te/information_source_entry/max_resv_link_bandwidth/te_bandwidth/otn/odulist/ts_number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_number() directly. + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False)""", + }) + + self.__ts_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_number(self): + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + + odu_type = __builtin__.property(_get_odu_type) + number = __builtin__.property(_get_number) + ts_number = __builtin__.property(_get_ts_number) + + + _pyangbind_elements = OrderedDict([('odu_type', odu_type), ('number', number), ('ts_number', ts_number), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/te_nsrlgs/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/te_nsrlgs/__init__.py new file mode 100644 index 000000000..a6704d845 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/te_nsrlgs/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class te_nsrlgs(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/te-nsrlgs. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains a list of NSRLGs (Non-Shared Risk Link Groups). +When an abstract TE link is configured, this list specifies +the request that underlay TE paths need to be mutually +disjoint with other TE links in the same groups. + """ + __slots__ = ('_path_helper', '_extmethods', '__id',) + + _yang_name = 'te-nsrlgs' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__id = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'information-source-entry', 'te-nsrlgs'] + + def _get_id(self): + """ + Getter method for id, mapped from YANG variable /networks/network/link/te/information_source_entry/te_nsrlgs/id (uint32) + + YANG Description: NSRLG ID, uniquely configured within a topology. + """ + return self.__id + + def _set_id(self, v, load=False): + """ + Setter method for id, mapped from YANG variable /networks/network/link/te/information_source_entry/te_nsrlgs/id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_id() directly. + + YANG Description: NSRLG ID, uniquely configured within a topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """id must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False)""", + }) + + self.__id = t + if hasattr(self, '_set'): + self._set() + + def _unset_id(self): + self.__id = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + id = __builtin__.property(_get_id) + + + _pyangbind_elements = OrderedDict([('id', id), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/te_srlgs/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/te_srlgs/__init__.py new file mode 100644 index 000000000..9c51afe6b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/te_srlgs/__init__.py @@ -0,0 +1,115 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class te_srlgs(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/te-srlgs. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains a list of SRLGs. + """ + __slots__ = ('_path_helper', '_extmethods', '__value',) + + _yang_name = 'te-srlgs' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__value = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:srlg', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'information-source-entry', 'te-srlgs'] + + def _get_value(self): + """ + Getter method for value, mapped from YANG variable /networks/network/link/te/information_source_entry/te_srlgs/value (te-types:srlg) + + YANG Description: SRLG value. + """ + return self.__value + + def _set_value(self, v, load=False): + """ + Setter method for value, mapped from YANG variable /networks/network/link/te/information_source_entry/te_srlgs/value (te-types:srlg) + If this variable is read-only (config: false) in the + source YANG file, then _set_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_value() directly. + + YANG Description: SRLG value. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:srlg', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """value must be of a type compatible with te-types:srlg""", + 'defined-type': "te-types:srlg", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:srlg', is_config=False)""", + }) + + self.__value = t + if hasattr(self, '_set'): + self._set() + + def _unset_value(self): + self.__value = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:srlg', is_config=False) + + value = __builtin__.property(_get_value) + + + _pyangbind_elements = OrderedDict([('value', value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/unreserved_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/unreserved_bandwidth/__init__.py new file mode 100644 index 000000000..a21517063 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/unreserved_bandwidth/__init__.py @@ -0,0 +1,163 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_bandwidth +class unreserved_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/unreserved-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unreserved bandwidth for priority levels 0-7. Units are in +bytes per second. + """ + __slots__ = ('_path_helper', '_extmethods', '__priority','__te_bandwidth',) + + _yang_name = 'unreserved-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'information-source-entry', 'unreserved-bandwidth'] + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/link/te/information_source_entry/unreserved_bandwidth/priority (uint8) + + YANG Description: Priority. + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/link/te/information_source_entry/unreserved_bandwidth/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: Priority. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + + + def _get_te_bandwidth(self): + """ + Getter method for te_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth (container) + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + return self.__te_bandwidth + + def _set_te_bandwidth(self, v, load=False): + """ + Setter method for te_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_bandwidth() directly. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_bandwidth(self): + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + priority = __builtin__.property(_get_priority) + te_bandwidth = __builtin__.property(_get_te_bandwidth) + + + _pyangbind_elements = OrderedDict([('priority', priority), ('te_bandwidth', te_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/__init__.py new file mode 100644 index 000000000..c786d1941 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/__init__.py @@ -0,0 +1,195 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/unreserved-bandwidth/te-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_bandwidth',) + + _yang_name = 'te-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'information-source-entry', 'unreserved-bandwidth', 'te-bandwidth'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/generic (te-bandwidth) + + YANG Description: Bandwidth specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/generic (te-bandwidth) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Bandwidth specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with te-bandwidth""", + 'defined-type': "ietf-te-topology:te-bandwidth", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/otn (container) + + YANG Description: Bandwidth attributes for OTN links + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Bandwidth attributes for OTN links + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_eth_bandwidth(self): + """ + Getter method for eth_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/eth_bandwidth (uint64) + + YANG Description: Available bandwith value expressed in kilobits per second + """ + return self.__eth_bandwidth + + def _set_eth_bandwidth(self, v, load=False): + """ + Setter method for eth_bandwidth, mapped from YANG variable /networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/eth_bandwidth (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_bandwidth() directly. + + YANG Description: Available bandwith value expressed in kilobits per second + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_bandwidth must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=False)""", + }) + + self.__eth_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_bandwidth(self): + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + eth_bandwidth = __builtin__.property(_get_eth_bandwidth) + + __choices__ = {'technology': {'generic': ['generic']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_bandwidth', eth_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/otn/__init__.py new file mode 100644 index 000000000..8e3a01bca --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/otn/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import odulist +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/unreserved-bandwidth/te-bandwidth/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Bandwidth attributes for OTN links + """ + __slots__ = ('_path_helper', '_extmethods', '__odulist',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'information-source-entry', 'unreserved-bandwidth', 'te-bandwidth', 'otn'] + + def _get_odulist(self): + """ + Getter method for odulist, mapped from YANG variable /networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/otn/odulist (list) + + YANG Description: OTN bandwidth definition + """ + return self.__odulist + + def _set_odulist(self, v, load=False): + """ + Setter method for odulist, mapped from YANG variable /networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/otn/odulist (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_odulist is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odulist() directly. + + YANG Description: OTN bandwidth definition + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odulist must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=False)""", + }) + + self.__odulist = t + if hasattr(self, '_set'): + self._set() + + def _unset_odulist(self): + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=False) + + odulist = __builtin__.property(_get_odulist) + + + _pyangbind_elements = OrderedDict([('odulist', odulist), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/otn/odulist/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/otn/odulist/__init__.py new file mode 100644 index 000000000..a0e9a8f1d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/otn/odulist/__init__.py @@ -0,0 +1,200 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class odulist(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-entry/unreserved-bandwidth/te-bandwidth/otn/odulist. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: OTN bandwidth definition + """ + __slots__ = ('_path_helper', '_extmethods', '__odu_type','__number','__ts_number',) + + _yang_name = 'odulist' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'information-source-entry', 'unreserved-bandwidth', 'te-bandwidth', 'otn', 'odulist'] + + def _get_odu_type(self): + """ + Getter method for odu_type, mapped from YANG variable /networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/otn/odulist/odu_type (identityref) + + YANG Description: ODU type + """ + return self.__odu_type + + def _set_odu_type(self, v, load=False): + """ + Setter method for odu_type, mapped from YANG variable /networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/otn/odulist/odu_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type() directly. + + YANG Description: ODU type + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__odu_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type(self): + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_number(self): + """ + Getter method for number, mapped from YANG variable /networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/otn/odulist/number (uint16) + + YANG Description: Number of ODUs + """ + return self.__number + + def _set_number(self, v, load=False): + """ + Setter method for number, mapped from YANG variable /networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/otn/odulist/number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_number() directly. + + YANG Description: Number of ODUs + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False)""", + }) + + self.__number = t + if hasattr(self, '_set'): + self._set() + + def _unset_number(self): + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + + + def _get_ts_number(self): + """ + Getter method for ts_number, mapped from YANG variable /networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/otn/odulist/ts_number (uint16) + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + return self.__ts_number + + def _set_ts_number(self, v, load=False): + """ + Setter method for ts_number, mapped from YANG variable /networks/network/link/te/information_source_entry/unreserved_bandwidth/te_bandwidth/otn/odulist/ts_number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_number() directly. + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False)""", + }) + + self.__ts_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_number(self): + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + + odu_type = __builtin__.property(_get_odu_type) + number = __builtin__.property(_get_number) + ts_number = __builtin__.property(_get_ts_number) + + + _pyangbind_elements = OrderedDict([('odu_type', odu_type), ('number', number), ('ts_number', ts_number), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_state/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_state/__init__.py new file mode 100644 index 000000000..4646d0026 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_state/__init__.py @@ -0,0 +1,248 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import topology +class information_source_state(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-state. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains state attributes related to the information +source. + """ + __slots__ = ('_path_helper', '_extmethods', '__credibility_preference','__logical_network_element','__network_instance','__topology',) + + _yang_name = 'information-source-state' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__credibility_preference = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="credibility-preference", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=False) + self.__logical_network_element = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="logical-network-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + self.__network_instance = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + self.__topology = YANGDynClass(base=topology.topology, is_container='container', yang_name="topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'information-source-state'] + + def _get_credibility_preference(self): + """ + Getter method for credibility_preference, mapped from YANG variable /networks/network/link/te/information_source_state/credibility_preference (uint16) + + YANG Description: The preference value for calculating the Traffic +Engineering database credibility value used for +tie-break selection between different information-source +values. A higher value is preferable. + """ + return self.__credibility_preference + + def _set_credibility_preference(self, v, load=False): + """ + Setter method for credibility_preference, mapped from YANG variable /networks/network/link/te/information_source_state/credibility_preference (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_credibility_preference is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_credibility_preference() directly. + + YANG Description: The preference value for calculating the Traffic +Engineering database credibility value used for +tie-break selection between different information-source +values. A higher value is preferable. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="credibility-preference", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """credibility_preference must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="credibility-preference", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=False)""", + }) + + self.__credibility_preference = t + if hasattr(self, '_set'): + self._set() + + def _unset_credibility_preference(self): + self.__credibility_preference = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="credibility-preference", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=False) + + + def _get_logical_network_element(self): + """ + Getter method for logical_network_element, mapped from YANG variable /networks/network/link/te/information_source_state/logical_network_element (string) + + YANG Description: When applicable, this is the name of a logical network +element from which the information is learned. + """ + return self.__logical_network_element + + def _set_logical_network_element(self, v, load=False): + """ + Setter method for logical_network_element, mapped from YANG variable /networks/network/link/te/information_source_state/logical_network_element (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_logical_network_element is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_logical_network_element() directly. + + YANG Description: When applicable, this is the name of a logical network +element from which the information is learned. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="logical-network-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """logical_network_element must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="logical-network-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__logical_network_element = t + if hasattr(self, '_set'): + self._set() + + def _unset_logical_network_element(self): + self.__logical_network_element = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="logical-network-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + + def _get_network_instance(self): + """ + Getter method for network_instance, mapped from YANG variable /networks/network/link/te/information_source_state/network_instance (string) + + YANG Description: When applicable, this is the name of a network instance +from which the information is learned. + """ + return self.__network_instance + + def _set_network_instance(self, v, load=False): + """ + Setter method for network_instance, mapped from YANG variable /networks/network/link/te/information_source_state/network_instance (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_instance is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_instance() directly. + + YANG Description: When applicable, this is the name of a network instance +from which the information is learned. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_instance must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__network_instance = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_instance(self): + self.__network_instance = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + + def _get_topology(self): + """ + Getter method for topology, mapped from YANG variable /networks/network/link/te/information_source_state/topology (container) + + YANG Description: When the information is processed by the system, +the attributes in this container indicate which topology +is used to generate the result information. + """ + return self.__topology + + def _set_topology(self, v, load=False): + """ + Setter method for topology, mapped from YANG variable /networks/network/link/te/information_source_state/topology (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_topology is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_topology() directly. + + YANG Description: When the information is processed by the system, +the attributes in this container indicate which topology +is used to generate the result information. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=topology.topology, is_container='container', yang_name="topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """topology must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=topology.topology, is_container='container', yang_name="topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__topology = t + if hasattr(self, '_set'): + self._set() + + def _unset_topology(self): + self.__topology = YANGDynClass(base=topology.topology, is_container='container', yang_name="topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + credibility_preference = __builtin__.property(_get_credibility_preference) + logical_network_element = __builtin__.property(_get_logical_network_element) + network_instance = __builtin__.property(_get_network_instance) + topology = __builtin__.property(_get_topology) + + + _pyangbind_elements = OrderedDict([('credibility_preference', credibility_preference), ('logical_network_element', logical_network_element), ('network_instance', network_instance), ('topology', topology), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_state/topology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_state/topology/__init__.py new file mode 100644 index 000000000..6a22bed59 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/information_source_state/topology/__init__.py @@ -0,0 +1,162 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class topology(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/information-source-state/topology. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: When the information is processed by the system, +the attributes in this container indicate which topology +is used to generate the result information. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_ref','__network_ref',) + + _yang_name = 'topology' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="link-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'information-source-state', 'topology'] + + def _get_link_ref(self): + """ + Getter method for link_ref, mapped from YANG variable /networks/network/link/te/information_source_state/topology/link_ref (leafref) + + YANG Description: A type for an absolute reference to a link instance. +(This type should not be used for relative references. +In such a case, a relative path should be used instead.) + """ + return self.__link_ref + + def _set_link_ref(self, v, load=False): + """ + Setter method for link_ref, mapped from YANG variable /networks/network/link/te/information_source_state/topology/link_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_ref() directly. + + YANG Description: A type for an absolute reference to a link instance. +(This type should not be used for relative references. +In such a case, a relative path should be used instead.) + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="link-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="link-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False)""", + }) + + self.__link_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_ref(self): + self.__link_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="link-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/link/te/information_source_state/topology/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/link/te/information_source_state/topology/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + + link_ref = __builtin__.property(_get_link_ref) + network_ref = __builtin__.property(_get_network_ref) + + + _pyangbind_elements = OrderedDict([('link_ref', link_ref), ('network_ref', network_ref), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/recovery/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/recovery/__init__.py new file mode 100644 index 000000000..441cf6d42 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/recovery/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class recovery(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/recovery. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Status of the recovery process. + """ + __slots__ = ('_path_helper', '_extmethods', '__restoration_status','__protection_status',) + + _yang_name = 'recovery' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__restoration_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'normal': {}, 'recovery-started': {}, 'recovery-succeeded': {}, 'recovery-failed': {}, 'reversion-started': {}, 'reversion-succeeded': {}, 'reversion-failed': {}, 'recovery-unavailable': {}, 'recovery-admin': {}, 'wait-to-restore': {}},), is_leaf=True, yang_name="restoration-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-recovery-status', is_config=False) + self.__protection_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'normal': {}, 'recovery-started': {}, 'recovery-succeeded': {}, 'recovery-failed': {}, 'reversion-started': {}, 'reversion-succeeded': {}, 'reversion-failed': {}, 'recovery-unavailable': {}, 'recovery-admin': {}, 'wait-to-restore': {}},), is_leaf=True, yang_name="protection-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-recovery-status', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'recovery'] + + def _get_restoration_status(self): + """ + Getter method for restoration_status, mapped from YANG variable /networks/network/link/te/recovery/restoration_status (te-types:te-recovery-status) + + YANG Description: Restoration status. + """ + return self.__restoration_status + + def _set_restoration_status(self, v, load=False): + """ + Setter method for restoration_status, mapped from YANG variable /networks/network/link/te/recovery/restoration_status (te-types:te-recovery-status) + If this variable is read-only (config: false) in the + source YANG file, then _set_restoration_status is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_restoration_status() directly. + + YANG Description: Restoration status. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'normal': {}, 'recovery-started': {}, 'recovery-succeeded': {}, 'recovery-failed': {}, 'reversion-started': {}, 'reversion-succeeded': {}, 'reversion-failed': {}, 'recovery-unavailable': {}, 'recovery-admin': {}, 'wait-to-restore': {}},), is_leaf=True, yang_name="restoration-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-recovery-status', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """restoration_status must be of a type compatible with te-types:te-recovery-status""", + 'defined-type': "te-types:te-recovery-status", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'normal': {}, 'recovery-started': {}, 'recovery-succeeded': {}, 'recovery-failed': {}, 'reversion-started': {}, 'reversion-succeeded': {}, 'reversion-failed': {}, 'recovery-unavailable': {}, 'recovery-admin': {}, 'wait-to-restore': {}},), is_leaf=True, yang_name="restoration-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-recovery-status', is_config=False)""", + }) + + self.__restoration_status = t + if hasattr(self, '_set'): + self._set() + + def _unset_restoration_status(self): + self.__restoration_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'normal': {}, 'recovery-started': {}, 'recovery-succeeded': {}, 'recovery-failed': {}, 'reversion-started': {}, 'reversion-succeeded': {}, 'reversion-failed': {}, 'recovery-unavailable': {}, 'recovery-admin': {}, 'wait-to-restore': {}},), is_leaf=True, yang_name="restoration-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-recovery-status', is_config=False) + + + def _get_protection_status(self): + """ + Getter method for protection_status, mapped from YANG variable /networks/network/link/te/recovery/protection_status (te-types:te-recovery-status) + + YANG Description: Protection status. + """ + return self.__protection_status + + def _set_protection_status(self, v, load=False): + """ + Setter method for protection_status, mapped from YANG variable /networks/network/link/te/recovery/protection_status (te-types:te-recovery-status) + If this variable is read-only (config: false) in the + source YANG file, then _set_protection_status is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_protection_status() directly. + + YANG Description: Protection status. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'normal': {}, 'recovery-started': {}, 'recovery-succeeded': {}, 'recovery-failed': {}, 'reversion-started': {}, 'reversion-succeeded': {}, 'reversion-failed': {}, 'recovery-unavailable': {}, 'recovery-admin': {}, 'wait-to-restore': {}},), is_leaf=True, yang_name="protection-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-recovery-status', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """protection_status must be of a type compatible with te-types:te-recovery-status""", + 'defined-type': "te-types:te-recovery-status", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'normal': {}, 'recovery-started': {}, 'recovery-succeeded': {}, 'recovery-failed': {}, 'reversion-started': {}, 'reversion-succeeded': {}, 'reversion-failed': {}, 'recovery-unavailable': {}, 'recovery-admin': {}, 'wait-to-restore': {}},), is_leaf=True, yang_name="protection-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-recovery-status', is_config=False)""", + }) + + self.__protection_status = t + if hasattr(self, '_set'): + self._set() + + def _unset_protection_status(self): + self.__protection_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'normal': {}, 'recovery-started': {}, 'recovery-succeeded': {}, 'recovery-failed': {}, 'reversion-started': {}, 'reversion-succeeded': {}, 'reversion-failed': {}, 'recovery-unavailable': {}, 'recovery-admin': {}, 'wait-to-restore': {}},), is_leaf=True, yang_name="protection-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-recovery-status', is_config=False) + + restoration_status = __builtin__.property(_get_restoration_status) + protection_status = __builtin__.property(_get_protection_status) + + + _pyangbind_elements = OrderedDict([('restoration_status', restoration_status), ('protection_status', protection_status), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/statistics/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/statistics/__init__.py new file mode 100644 index 000000000..cbfbda90f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/statistics/__init__.py @@ -0,0 +1,810 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class statistics(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/statistics. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Statistics data. + """ + __slots__ = ('_path_helper', '_extmethods', '__discontinuity_time','__disables','__enables','__maintenance_clears','__maintenance_sets','__modifies','__downs','__ups','__fault_clears','__fault_detects','__protection_switches','__protection_reverts','__restoration_failures','__restoration_starts','__restoration_successes','__restoration_reversion_failures','__restoration_reversion_starts','__restoration_reversion_successes',) + + _yang_name = 'statistics' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__discontinuity_time = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[\\+\\-]\\d{2}:\\d{2})'}), is_leaf=True, yang_name="discontinuity-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:date-and-time', is_config=False) + self.__disables = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="disables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__enables = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="enables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__maintenance_clears = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="maintenance-clears", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__maintenance_sets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="maintenance-sets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__modifies = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="modifies", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__downs = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="downs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__ups = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="ups", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__fault_clears = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="fault-clears", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__fault_detects = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="fault-detects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__protection_switches = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="protection-switches", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__protection_reverts = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="protection-reverts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__restoration_failures = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="restoration-failures", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__restoration_starts = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="restoration-starts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__restoration_successes = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="restoration-successes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__restoration_reversion_failures = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="restoration-reversion-failures", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__restoration_reversion_starts = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="restoration-reversion-starts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__restoration_reversion_successes = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="restoration-reversion-successes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'statistics'] + + def _get_discontinuity_time(self): + """ + Getter method for discontinuity_time, mapped from YANG variable /networks/network/link/te/statistics/discontinuity_time (yang:date-and-time) + + YANG Description: The time of the most recent occasion at which any one or +more of this interface's counters suffered a +discontinuity. If no such discontinuities have occurred +since the last re-initialization of the local management +subsystem, then this node contains the time the local +management subsystem re-initialized itself. + """ + return self.__discontinuity_time + + def _set_discontinuity_time(self, v, load=False): + """ + Setter method for discontinuity_time, mapped from YANG variable /networks/network/link/te/statistics/discontinuity_time (yang:date-and-time) + If this variable is read-only (config: false) in the + source YANG file, then _set_discontinuity_time is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_discontinuity_time() directly. + + YANG Description: The time of the most recent occasion at which any one or +more of this interface's counters suffered a +discontinuity. If no such discontinuities have occurred +since the last re-initialization of the local management +subsystem, then this node contains the time the local +management subsystem re-initialized itself. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[\\+\\-]\\d{2}:\\d{2})'}), is_leaf=True, yang_name="discontinuity-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:date-and-time', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """discontinuity_time must be of a type compatible with yang:date-and-time""", + 'defined-type': "yang:date-and-time", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[\\+\\-]\\d{2}:\\d{2})'}), is_leaf=True, yang_name="discontinuity-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:date-and-time', is_config=False)""", + }) + + self.__discontinuity_time = t + if hasattr(self, '_set'): + self._set() + + def _unset_discontinuity_time(self): + self.__discontinuity_time = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[\\+\\-]\\d{2}:\\d{2})'}), is_leaf=True, yang_name="discontinuity-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:date-and-time', is_config=False) + + + def _get_disables(self): + """ + Getter method for disables, mapped from YANG variable /networks/network/link/te/statistics/disables (yang:counter32) + + YANG Description: Number of times that a link was disabled. + """ + return self.__disables + + def _set_disables(self, v, load=False): + """ + Setter method for disables, mapped from YANG variable /networks/network/link/te/statistics/disables (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_disables is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_disables() directly. + + YANG Description: Number of times that a link was disabled. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="disables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """disables must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="disables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__disables = t + if hasattr(self, '_set'): + self._set() + + def _unset_disables(self): + self.__disables = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="disables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_enables(self): + """ + Getter method for enables, mapped from YANG variable /networks/network/link/te/statistics/enables (yang:counter32) + + YANG Description: Number of times that a link was enabled. + """ + return self.__enables + + def _set_enables(self, v, load=False): + """ + Setter method for enables, mapped from YANG variable /networks/network/link/te/statistics/enables (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_enables is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_enables() directly. + + YANG Description: Number of times that a link was enabled. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="enables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """enables must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="enables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__enables = t + if hasattr(self, '_set'): + self._set() + + def _unset_enables(self): + self.__enables = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="enables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_maintenance_clears(self): + """ + Getter method for maintenance_clears, mapped from YANG variable /networks/network/link/te/statistics/maintenance_clears (yang:counter32) + + YANG Description: Number of times that a link was taken out of maintenance. + """ + return self.__maintenance_clears + + def _set_maintenance_clears(self, v, load=False): + """ + Setter method for maintenance_clears, mapped from YANG variable /networks/network/link/te/statistics/maintenance_clears (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_maintenance_clears is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_maintenance_clears() directly. + + YANG Description: Number of times that a link was taken out of maintenance. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="maintenance-clears", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """maintenance_clears must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="maintenance-clears", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__maintenance_clears = t + if hasattr(self, '_set'): + self._set() + + def _unset_maintenance_clears(self): + self.__maintenance_clears = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="maintenance-clears", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_maintenance_sets(self): + """ + Getter method for maintenance_sets, mapped from YANG variable /networks/network/link/te/statistics/maintenance_sets (yang:counter32) + + YANG Description: Number of times that a link was put in maintenance. + """ + return self.__maintenance_sets + + def _set_maintenance_sets(self, v, load=False): + """ + Setter method for maintenance_sets, mapped from YANG variable /networks/network/link/te/statistics/maintenance_sets (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_maintenance_sets is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_maintenance_sets() directly. + + YANG Description: Number of times that a link was put in maintenance. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="maintenance-sets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """maintenance_sets must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="maintenance-sets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__maintenance_sets = t + if hasattr(self, '_set'): + self._set() + + def _unset_maintenance_sets(self): + self.__maintenance_sets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="maintenance-sets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_modifies(self): + """ + Getter method for modifies, mapped from YANG variable /networks/network/link/te/statistics/modifies (yang:counter32) + + YANG Description: Number of times that a link was modified. + """ + return self.__modifies + + def _set_modifies(self, v, load=False): + """ + Setter method for modifies, mapped from YANG variable /networks/network/link/te/statistics/modifies (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_modifies is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_modifies() directly. + + YANG Description: Number of times that a link was modified. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="modifies", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """modifies must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="modifies", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__modifies = t + if hasattr(self, '_set'): + self._set() + + def _unset_modifies(self): + self.__modifies = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="modifies", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_downs(self): + """ + Getter method for downs, mapped from YANG variable /networks/network/link/te/statistics/downs (yang:counter32) + + YANG Description: Number of times that a link was set to an operational state +of 'down'. + """ + return self.__downs + + def _set_downs(self, v, load=False): + """ + Setter method for downs, mapped from YANG variable /networks/network/link/te/statistics/downs (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_downs is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_downs() directly. + + YANG Description: Number of times that a link was set to an operational state +of 'down'. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="downs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """downs must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="downs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__downs = t + if hasattr(self, '_set'): + self._set() + + def _unset_downs(self): + self.__downs = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="downs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_ups(self): + """ + Getter method for ups, mapped from YANG variable /networks/network/link/te/statistics/ups (yang:counter32) + + YANG Description: Number of times that a link was set to an operational state +of 'up'. + """ + return self.__ups + + def _set_ups(self, v, load=False): + """ + Setter method for ups, mapped from YANG variable /networks/network/link/te/statistics/ups (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_ups is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ups() directly. + + YANG Description: Number of times that a link was set to an operational state +of 'up'. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="ups", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ups must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="ups", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__ups = t + if hasattr(self, '_set'): + self._set() + + def _unset_ups(self): + self.__ups = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="ups", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_fault_clears(self): + """ + Getter method for fault_clears, mapped from YANG variable /networks/network/link/te/statistics/fault_clears (yang:counter32) + + YANG Description: Number of times that a link experienced a fault-clear +event. + """ + return self.__fault_clears + + def _set_fault_clears(self, v, load=False): + """ + Setter method for fault_clears, mapped from YANG variable /networks/network/link/te/statistics/fault_clears (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_fault_clears is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_fault_clears() directly. + + YANG Description: Number of times that a link experienced a fault-clear +event. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="fault-clears", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """fault_clears must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="fault-clears", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__fault_clears = t + if hasattr(self, '_set'): + self._set() + + def _unset_fault_clears(self): + self.__fault_clears = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="fault-clears", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_fault_detects(self): + """ + Getter method for fault_detects, mapped from YANG variable /networks/network/link/te/statistics/fault_detects (yang:counter32) + + YANG Description: Number of times that a link experienced fault detection. + """ + return self.__fault_detects + + def _set_fault_detects(self, v, load=False): + """ + Setter method for fault_detects, mapped from YANG variable /networks/network/link/te/statistics/fault_detects (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_fault_detects is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_fault_detects() directly. + + YANG Description: Number of times that a link experienced fault detection. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="fault-detects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """fault_detects must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="fault-detects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__fault_detects = t + if hasattr(self, '_set'): + self._set() + + def _unset_fault_detects(self): + self.__fault_detects = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="fault-detects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_protection_switches(self): + """ + Getter method for protection_switches, mapped from YANG variable /networks/network/link/te/statistics/protection_switches (yang:counter32) + + YANG Description: Number of times that a link experienced protection +switchover. + """ + return self.__protection_switches + + def _set_protection_switches(self, v, load=False): + """ + Setter method for protection_switches, mapped from YANG variable /networks/network/link/te/statistics/protection_switches (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_protection_switches is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_protection_switches() directly. + + YANG Description: Number of times that a link experienced protection +switchover. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="protection-switches", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """protection_switches must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="protection-switches", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__protection_switches = t + if hasattr(self, '_set'): + self._set() + + def _unset_protection_switches(self): + self.__protection_switches = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="protection-switches", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_protection_reverts(self): + """ + Getter method for protection_reverts, mapped from YANG variable /networks/network/link/te/statistics/protection_reverts (yang:counter32) + + YANG Description: Number of times that a link experienced protection +reversion. + """ + return self.__protection_reverts + + def _set_protection_reverts(self, v, load=False): + """ + Setter method for protection_reverts, mapped from YANG variable /networks/network/link/te/statistics/protection_reverts (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_protection_reverts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_protection_reverts() directly. + + YANG Description: Number of times that a link experienced protection +reversion. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="protection-reverts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """protection_reverts must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="protection-reverts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__protection_reverts = t + if hasattr(self, '_set'): + self._set() + + def _unset_protection_reverts(self): + self.__protection_reverts = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="protection-reverts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_restoration_failures(self): + """ + Getter method for restoration_failures, mapped from YANG variable /networks/network/link/te/statistics/restoration_failures (yang:counter32) + + YANG Description: Number of times that a link experienced restoration +failure. + """ + return self.__restoration_failures + + def _set_restoration_failures(self, v, load=False): + """ + Setter method for restoration_failures, mapped from YANG variable /networks/network/link/te/statistics/restoration_failures (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_restoration_failures is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_restoration_failures() directly. + + YANG Description: Number of times that a link experienced restoration +failure. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="restoration-failures", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """restoration_failures must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="restoration-failures", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__restoration_failures = t + if hasattr(self, '_set'): + self._set() + + def _unset_restoration_failures(self): + self.__restoration_failures = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="restoration-failures", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_restoration_starts(self): + """ + Getter method for restoration_starts, mapped from YANG variable /networks/network/link/te/statistics/restoration_starts (yang:counter32) + + YANG Description: Number of times that a link experienced restoration +start. + """ + return self.__restoration_starts + + def _set_restoration_starts(self, v, load=False): + """ + Setter method for restoration_starts, mapped from YANG variable /networks/network/link/te/statistics/restoration_starts (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_restoration_starts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_restoration_starts() directly. + + YANG Description: Number of times that a link experienced restoration +start. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="restoration-starts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """restoration_starts must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="restoration-starts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__restoration_starts = t + if hasattr(self, '_set'): + self._set() + + def _unset_restoration_starts(self): + self.__restoration_starts = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="restoration-starts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_restoration_successes(self): + """ + Getter method for restoration_successes, mapped from YANG variable /networks/network/link/te/statistics/restoration_successes (yang:counter32) + + YANG Description: Number of times that a link experienced restoration +success. + """ + return self.__restoration_successes + + def _set_restoration_successes(self, v, load=False): + """ + Setter method for restoration_successes, mapped from YANG variable /networks/network/link/te/statistics/restoration_successes (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_restoration_successes is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_restoration_successes() directly. + + YANG Description: Number of times that a link experienced restoration +success. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="restoration-successes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """restoration_successes must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="restoration-successes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__restoration_successes = t + if hasattr(self, '_set'): + self._set() + + def _unset_restoration_successes(self): + self.__restoration_successes = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="restoration-successes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_restoration_reversion_failures(self): + """ + Getter method for restoration_reversion_failures, mapped from YANG variable /networks/network/link/te/statistics/restoration_reversion_failures (yang:counter32) + + YANG Description: Number of times that a link experienced restoration +reversion failure. + """ + return self.__restoration_reversion_failures + + def _set_restoration_reversion_failures(self, v, load=False): + """ + Setter method for restoration_reversion_failures, mapped from YANG variable /networks/network/link/te/statistics/restoration_reversion_failures (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_restoration_reversion_failures is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_restoration_reversion_failures() directly. + + YANG Description: Number of times that a link experienced restoration +reversion failure. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="restoration-reversion-failures", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """restoration_reversion_failures must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="restoration-reversion-failures", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__restoration_reversion_failures = t + if hasattr(self, '_set'): + self._set() + + def _unset_restoration_reversion_failures(self): + self.__restoration_reversion_failures = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="restoration-reversion-failures", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_restoration_reversion_starts(self): + """ + Getter method for restoration_reversion_starts, mapped from YANG variable /networks/network/link/te/statistics/restoration_reversion_starts (yang:counter32) + + YANG Description: Number of times that a link experienced restoration +reversion start. + """ + return self.__restoration_reversion_starts + + def _set_restoration_reversion_starts(self, v, load=False): + """ + Setter method for restoration_reversion_starts, mapped from YANG variable /networks/network/link/te/statistics/restoration_reversion_starts (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_restoration_reversion_starts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_restoration_reversion_starts() directly. + + YANG Description: Number of times that a link experienced restoration +reversion start. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="restoration-reversion-starts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """restoration_reversion_starts must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="restoration-reversion-starts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__restoration_reversion_starts = t + if hasattr(self, '_set'): + self._set() + + def _unset_restoration_reversion_starts(self): + self.__restoration_reversion_starts = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="restoration-reversion-starts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_restoration_reversion_successes(self): + """ + Getter method for restoration_reversion_successes, mapped from YANG variable /networks/network/link/te/statistics/restoration_reversion_successes (yang:counter32) + + YANG Description: Number of times that a link experienced restoration +reversion success. + """ + return self.__restoration_reversion_successes + + def _set_restoration_reversion_successes(self, v, load=False): + """ + Setter method for restoration_reversion_successes, mapped from YANG variable /networks/network/link/te/statistics/restoration_reversion_successes (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_restoration_reversion_successes is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_restoration_reversion_successes() directly. + + YANG Description: Number of times that a link experienced restoration +reversion success. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="restoration-reversion-successes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """restoration_reversion_successes must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="restoration-reversion-successes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__restoration_reversion_successes = t + if hasattr(self, '_set'): + self._set() + + def _unset_restoration_reversion_successes(self): + self.__restoration_reversion_successes = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="restoration-reversion-successes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + discontinuity_time = __builtin__.property(_get_discontinuity_time) + disables = __builtin__.property(_get_disables) + enables = __builtin__.property(_get_enables) + maintenance_clears = __builtin__.property(_get_maintenance_clears) + maintenance_sets = __builtin__.property(_get_maintenance_sets) + modifies = __builtin__.property(_get_modifies) + downs = __builtin__.property(_get_downs) + ups = __builtin__.property(_get_ups) + fault_clears = __builtin__.property(_get_fault_clears) + fault_detects = __builtin__.property(_get_fault_detects) + protection_switches = __builtin__.property(_get_protection_switches) + protection_reverts = __builtin__.property(_get_protection_reverts) + restoration_failures = __builtin__.property(_get_restoration_failures) + restoration_starts = __builtin__.property(_get_restoration_starts) + restoration_successes = __builtin__.property(_get_restoration_successes) + restoration_reversion_failures = __builtin__.property(_get_restoration_reversion_failures) + restoration_reversion_starts = __builtin__.property(_get_restoration_reversion_starts) + restoration_reversion_successes = __builtin__.property(_get_restoration_reversion_successes) + + + _pyangbind_elements = OrderedDict([('discontinuity_time', discontinuity_time), ('disables', disables), ('enables', enables), ('maintenance_clears', maintenance_clears), ('maintenance_sets', maintenance_sets), ('modifies', modifies), ('downs', downs), ('ups', ups), ('fault_clears', fault_clears), ('fault_detects', fault_detects), ('protection_switches', protection_switches), ('protection_reverts', protection_reverts), ('restoration_failures', restoration_failures), ('restoration_starts', restoration_starts), ('restoration_successes', restoration_successes), ('restoration_reversion_failures', restoration_reversion_failures), ('restoration_reversion_starts', restoration_reversion_starts), ('restoration_reversion_successes', restoration_reversion_successes), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/__init__.py new file mode 100644 index 000000000..f83e385c4 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/__init__.py @@ -0,0 +1,938 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import external_domain +from . import underlay +from . import interface_switching_capability +from . import label_restrictions +from . import max_link_bandwidth +from . import max_resv_link_bandwidth +from . import unreserved_bandwidth +from . import te_srlgs +from . import te_nsrlgs +from . import otn_link +from . import client_svc +class te_link_attributes(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Link attributes in a TE topology. + """ + __slots__ = ('_path_helper', '_extmethods', '__access_type','__external_domain','__is_abstract','__name','__underlay','__admin_status','__link_index','__administrative_group','__interface_switching_capability','__label_restrictions','__link_protection_type','__max_link_bandwidth','__max_resv_link_bandwidth','__unreserved_bandwidth','__te_default_metric','__te_delay_metric','__te_igp_metric','__te_srlgs','__te_nsrlgs','__otn_link','__client_svc',) + + _yang_name = 'te-link-attributes' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__access_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'point-to-point': {}, 'multi-access': {}},), is_leaf=True, yang_name="access-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-link-access-type', is_config=True) + self.__external_domain = YANGDynClass(base=external_domain.external_domain, is_container='container', yang_name="external-domain", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__is_abstract = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-abstract", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=True) + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + self.__underlay = YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__admin_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True) + self.__link_index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="link-index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=True) + self.__administrative_group = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], is_leaf=True, yang_name="administrative-group", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:admin-groups', is_config=True) + self.__interface_switching_capability = YANGDynClass(base=YANGListType("switching_capability encoding",interface_switching_capability.interface_switching_capability, yang_name="interface-switching-capability", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='switching-capability encoding', extensions=None), is_container='list', yang_name="interface-switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + self.__label_restrictions = YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__link_protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="link-protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__max_link_bandwidth = YANGDynClass(base=max_link_bandwidth.max_link_bandwidth, is_container='container', yang_name="max-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__max_resv_link_bandwidth = YANGDynClass(base=max_resv_link_bandwidth.max_resv_link_bandwidth, is_container='container', yang_name="max-resv-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__unreserved_bandwidth = YANGDynClass(base=YANGListType("priority",unreserved_bandwidth.unreserved_bandwidth, yang_name="unreserved-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="unreserved-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + self.__te_default_metric = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-default-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__te_delay_metric = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-delay-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__te_igp_metric = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-igp-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__te_srlgs = YANGDynClass(base=te_srlgs.te_srlgs, is_container='container', yang_name="te-srlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__te_nsrlgs = YANGDynClass(base=te_nsrlgs.te_nsrlgs, is_container='container', yang_name="te-nsrlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__otn_link = YANGDynClass(base=otn_link.otn_link, is_container='container', yang_name="otn-link", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__client_svc = YANGDynClass(base=client_svc.client_svc, is_container='container', yang_name="client-svc", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes'] + + def _get_access_type(self): + """ + Getter method for access_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/access_type (te-types:te-link-access-type) + + YANG Description: Link access type, which can be point-to-point or +multi-access. + """ + return self.__access_type + + def _set_access_type(self, v, load=False): + """ + Setter method for access_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/access_type (te-types:te-link-access-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_access_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_access_type() directly. + + YANG Description: Link access type, which can be point-to-point or +multi-access. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'point-to-point': {}, 'multi-access': {}},), is_leaf=True, yang_name="access-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-link-access-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """access_type must be of a type compatible with te-types:te-link-access-type""", + 'defined-type': "te-types:te-link-access-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'point-to-point': {}, 'multi-access': {}},), is_leaf=True, yang_name="access-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-link-access-type', is_config=True)""", + }) + + self.__access_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_access_type(self): + self.__access_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'point-to-point': {}, 'multi-access': {}},), is_leaf=True, yang_name="access-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-link-access-type', is_config=True) + + + def _get_external_domain(self): + """ + Getter method for external_domain, mapped from YANG variable /networks/network/link/te/te_link_attributes/external_domain (container) + + YANG Description: For an inter-domain link, specifies the attributes of +the remote end of the link, to facilitate the signaling at +the local end. + """ + return self.__external_domain + + def _set_external_domain(self, v, load=False): + """ + Setter method for external_domain, mapped from YANG variable /networks/network/link/te/te_link_attributes/external_domain (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_external_domain is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_external_domain() directly. + + YANG Description: For an inter-domain link, specifies the attributes of +the remote end of the link, to facilitate the signaling at +the local end. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=external_domain.external_domain, is_container='container', yang_name="external-domain", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """external_domain must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=external_domain.external_domain, is_container='container', yang_name="external-domain", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__external_domain = t + if hasattr(self, '_set'): + self._set() + + def _unset_external_domain(self): + self.__external_domain = YANGDynClass(base=external_domain.external_domain, is_container='container', yang_name="external-domain", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_is_abstract(self): + """ + Getter method for is_abstract, mapped from YANG variable /networks/network/link/te/te_link_attributes/is_abstract (empty) + + YANG Description: Present if the link is abstract. + """ + return self.__is_abstract + + def _set_is_abstract(self, v, load=False): + """ + Setter method for is_abstract, mapped from YANG variable /networks/network/link/te/te_link_attributes/is_abstract (empty) + If this variable is read-only (config: false) in the + source YANG file, then _set_is_abstract is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_is_abstract() directly. + + YANG Description: Present if the link is abstract. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="is-abstract", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """is_abstract must be of a type compatible with empty""", + 'defined-type': "empty", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-abstract", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=True)""", + }) + + self.__is_abstract = t + if hasattr(self, '_set'): + self._set() + + def _unset_is_abstract(self): + self.__is_abstract = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-abstract", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=True) + + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /networks/network/link/te/te_link_attributes/name (string) + + YANG Description: Link name. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /networks/network/link/te/te_link_attributes/name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: Link name. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + + def _get_underlay(self): + """ + Getter method for underlay, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay (container) + + YANG Description: Attributes of the TE link underlay. + """ + return self.__underlay + + def _set_underlay(self, v, load=False): + """ + Setter method for underlay, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_underlay is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_underlay() directly. + + YANG Description: Attributes of the TE link underlay. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """underlay must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__underlay = t + if hasattr(self, '_set'): + self._set() + + def _unset_underlay(self): + self.__underlay = YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_admin_status(self): + """ + Getter method for admin_status, mapped from YANG variable /networks/network/link/te/te_link_attributes/admin_status (te-types:te-admin-status) + + YANG Description: The administrative state of the link. + """ + return self.__admin_status + + def _set_admin_status(self, v, load=False): + """ + Setter method for admin_status, mapped from YANG variable /networks/network/link/te/te_link_attributes/admin_status (te-types:te-admin-status) + If this variable is read-only (config: false) in the + source YANG file, then _set_admin_status is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_admin_status() directly. + + YANG Description: The administrative state of the link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """admin_status must be of a type compatible with te-types:te-admin-status""", + 'defined-type': "te-types:te-admin-status", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True)""", + }) + + self.__admin_status = t + if hasattr(self, '_set'): + self._set() + + def _unset_admin_status(self): + self.__admin_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True) + + + def _get_link_index(self): + """ + Getter method for link_index, mapped from YANG variable /networks/network/link/te/te_link_attributes/link_index (uint64) + + YANG Description: The link identifier. If OSPF is used, this object +represents an ospfLsdbID. If IS-IS is used, this object +represents an isisLSPID. If a locally configured link is +used, this object represents a unique value, which is +locally defined in a router. + """ + return self.__link_index + + def _set_link_index(self, v, load=False): + """ + Setter method for link_index, mapped from YANG variable /networks/network/link/te/te_link_attributes/link_index (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_index() directly. + + YANG Description: The link identifier. If OSPF is used, this object +represents an ospfLsdbID. If IS-IS is used, this object +represents an isisLSPID. If a locally configured link is +used, this object represents a unique value, which is +locally defined in a router. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="link-index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_index must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="link-index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__link_index = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_index(self): + self.__link_index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="link-index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=True) + + + def _get_administrative_group(self): + """ + Getter method for administrative_group, mapped from YANG variable /networks/network/link/te/te_link_attributes/administrative_group (te-types:admin-groups) + + YANG Description: Administrative group or color of the link. +This attribute covers both administrative groups (defined +in RFCs 3630 and 5305) and Extended Administrative Groups +(defined in RFC 7308). + """ + return self.__administrative_group + + def _set_administrative_group(self, v, load=False): + """ + Setter method for administrative_group, mapped from YANG variable /networks/network/link/te/te_link_attributes/administrative_group (te-types:admin-groups) + If this variable is read-only (config: false) in the + source YANG file, then _set_administrative_group is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_administrative_group() directly. + + YANG Description: Administrative group or color of the link. +This attribute covers both administrative groups (defined +in RFCs 3630 and 5305) and Extended Administrative Groups +(defined in RFC 7308). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], is_leaf=True, yang_name="administrative-group", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:admin-groups', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """administrative_group must be of a type compatible with te-types:admin-groups""", + 'defined-type': "te-types:admin-groups", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], is_leaf=True, yang_name="administrative-group", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:admin-groups', is_config=True)""", + }) + + self.__administrative_group = t + if hasattr(self, '_set'): + self._set() + + def _unset_administrative_group(self): + self.__administrative_group = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], is_leaf=True, yang_name="administrative-group", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:admin-groups', is_config=True) + + + def _get_interface_switching_capability(self): + """ + Getter method for interface_switching_capability, mapped from YANG variable /networks/network/link/te/te_link_attributes/interface_switching_capability (list) + + YANG Description: List of ISCDs for this link. + """ + return self.__interface_switching_capability + + def _set_interface_switching_capability(self, v, load=False): + """ + Setter method for interface_switching_capability, mapped from YANG variable /networks/network/link/te/te_link_attributes/interface_switching_capability (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_interface_switching_capability is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_interface_switching_capability() directly. + + YANG Description: List of ISCDs for this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("switching_capability encoding",interface_switching_capability.interface_switching_capability, yang_name="interface-switching-capability", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='switching-capability encoding', extensions=None), is_container='list', yang_name="interface-switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """interface_switching_capability must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("switching_capability encoding",interface_switching_capability.interface_switching_capability, yang_name="interface-switching-capability", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='switching-capability encoding', extensions=None), is_container='list', yang_name="interface-switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__interface_switching_capability = t + if hasattr(self, '_set'): + self._set() + + def _unset_interface_switching_capability(self): + self.__interface_switching_capability = YANGDynClass(base=YANGListType("switching_capability encoding",interface_switching_capability.interface_switching_capability, yang_name="interface-switching-capability", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='switching-capability encoding', extensions=None), is_container='list', yang_name="interface-switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + + def _get_label_restrictions(self): + """ + Getter method for label_restrictions, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions (container) + + YANG Description: The label restrictions container. + """ + return self.__label_restrictions + + def _set_label_restrictions(self, v, load=False): + """ + Setter method for label_restrictions, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_restrictions is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_restrictions() directly. + + YANG Description: The label restrictions container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_restrictions must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_restrictions = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_restrictions(self): + self.__label_restrictions = YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_link_protection_type(self): + """ + Getter method for link_protection_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/link_protection_type (identityref) + + YANG Description: Link Protection Type desired for this link. + """ + return self.__link_protection_type + + def _set_link_protection_type(self, v, load=False): + """ + Setter method for link_protection_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/link_protection_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_protection_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_protection_type() directly. + + YANG Description: Link Protection Type desired for this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="link-protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_protection_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="link-protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__link_protection_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_protection_type(self): + self.__link_protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="link-protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_max_link_bandwidth(self): + """ + Getter method for max_link_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_link_bandwidth (container) + + YANG Description: Maximum bandwidth that can be seen on this link in this +direction. Units are in bytes per second. + """ + return self.__max_link_bandwidth + + def _set_max_link_bandwidth(self, v, load=False): + """ + Setter method for max_link_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_link_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_max_link_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_max_link_bandwidth() directly. + + YANG Description: Maximum bandwidth that can be seen on this link in this +direction. Units are in bytes per second. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=max_link_bandwidth.max_link_bandwidth, is_container='container', yang_name="max-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """max_link_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=max_link_bandwidth.max_link_bandwidth, is_container='container', yang_name="max-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__max_link_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_max_link_bandwidth(self): + self.__max_link_bandwidth = YANGDynClass(base=max_link_bandwidth.max_link_bandwidth, is_container='container', yang_name="max-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_max_resv_link_bandwidth(self): + """ + Getter method for max_resv_link_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_resv_link_bandwidth (container) + + YANG Description: Maximum amount of bandwidth that can be reserved in this +direction in this link. Units are in bytes per second. + """ + return self.__max_resv_link_bandwidth + + def _set_max_resv_link_bandwidth(self, v, load=False): + """ + Setter method for max_resv_link_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_resv_link_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_max_resv_link_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_max_resv_link_bandwidth() directly. + + YANG Description: Maximum amount of bandwidth that can be reserved in this +direction in this link. Units are in bytes per second. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=max_resv_link_bandwidth.max_resv_link_bandwidth, is_container='container', yang_name="max-resv-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """max_resv_link_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=max_resv_link_bandwidth.max_resv_link_bandwidth, is_container='container', yang_name="max-resv-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__max_resv_link_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_max_resv_link_bandwidth(self): + self.__max_resv_link_bandwidth = YANGDynClass(base=max_resv_link_bandwidth.max_resv_link_bandwidth, is_container='container', yang_name="max-resv-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_unreserved_bandwidth(self): + """ + Getter method for unreserved_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/unreserved_bandwidth (list) + + YANG Description: Unreserved bandwidth for priority levels 0-7. Units are in +bytes per second. + """ + return self.__unreserved_bandwidth + + def _set_unreserved_bandwidth(self, v, load=False): + """ + Setter method for unreserved_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/unreserved_bandwidth (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_unreserved_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unreserved_bandwidth() directly. + + YANG Description: Unreserved bandwidth for priority levels 0-7. Units are in +bytes per second. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("priority",unreserved_bandwidth.unreserved_bandwidth, yang_name="unreserved-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="unreserved-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unreserved_bandwidth must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("priority",unreserved_bandwidth.unreserved_bandwidth, yang_name="unreserved-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="unreserved-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__unreserved_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_unreserved_bandwidth(self): + self.__unreserved_bandwidth = YANGDynClass(base=YANGListType("priority",unreserved_bandwidth.unreserved_bandwidth, yang_name="unreserved-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="unreserved-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + + def _get_te_default_metric(self): + """ + Getter method for te_default_metric, mapped from YANG variable /networks/network/link/te/te_link_attributes/te_default_metric (uint32) + + YANG Description: Traffic Engineering metric. + """ + return self.__te_default_metric + + def _set_te_default_metric(self, v, load=False): + """ + Setter method for te_default_metric, mapped from YANG variable /networks/network/link/te/te_link_attributes/te_default_metric (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_default_metric is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_default_metric() directly. + + YANG Description: Traffic Engineering metric. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-default-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_default_metric must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-default-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__te_default_metric = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_default_metric(self): + self.__te_default_metric = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-default-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_te_delay_metric(self): + """ + Getter method for te_delay_metric, mapped from YANG variable /networks/network/link/te/te_link_attributes/te_delay_metric (uint32) + + YANG Description: Traffic Engineering delay metric. + """ + return self.__te_delay_metric + + def _set_te_delay_metric(self, v, load=False): + """ + Setter method for te_delay_metric, mapped from YANG variable /networks/network/link/te/te_link_attributes/te_delay_metric (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_delay_metric is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_delay_metric() directly. + + YANG Description: Traffic Engineering delay metric. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-delay-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_delay_metric must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-delay-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__te_delay_metric = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_delay_metric(self): + self.__te_delay_metric = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-delay-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_te_igp_metric(self): + """ + Getter method for te_igp_metric, mapped from YANG variable /networks/network/link/te/te_link_attributes/te_igp_metric (uint32) + + YANG Description: IGP metric used for Traffic Engineering. + """ + return self.__te_igp_metric + + def _set_te_igp_metric(self, v, load=False): + """ + Setter method for te_igp_metric, mapped from YANG variable /networks/network/link/te/te_link_attributes/te_igp_metric (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_igp_metric is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_igp_metric() directly. + + YANG Description: IGP metric used for Traffic Engineering. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-igp-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_igp_metric must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-igp-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__te_igp_metric = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_igp_metric(self): + self.__te_igp_metric = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-igp-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_te_srlgs(self): + """ + Getter method for te_srlgs, mapped from YANG variable /networks/network/link/te/te_link_attributes/te_srlgs (container) + + YANG Description: Contains a list of SRLGs. + """ + return self.__te_srlgs + + def _set_te_srlgs(self, v, load=False): + """ + Setter method for te_srlgs, mapped from YANG variable /networks/network/link/te/te_link_attributes/te_srlgs (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_srlgs is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_srlgs() directly. + + YANG Description: Contains a list of SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_srlgs.te_srlgs, is_container='container', yang_name="te-srlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_srlgs must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_srlgs.te_srlgs, is_container='container', yang_name="te-srlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_srlgs = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_srlgs(self): + self.__te_srlgs = YANGDynClass(base=te_srlgs.te_srlgs, is_container='container', yang_name="te-srlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_te_nsrlgs(self): + """ + Getter method for te_nsrlgs, mapped from YANG variable /networks/network/link/te/te_link_attributes/te_nsrlgs (container) + + YANG Description: Contains a list of NSRLGs (Non-Shared Risk Link Groups). +When an abstract TE link is configured, this list specifies +the request that underlay TE paths need to be mutually +disjoint with other TE links in the same groups. + """ + return self.__te_nsrlgs + + def _set_te_nsrlgs(self, v, load=False): + """ + Setter method for te_nsrlgs, mapped from YANG variable /networks/network/link/te/te_link_attributes/te_nsrlgs (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_nsrlgs is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_nsrlgs() directly. + + YANG Description: Contains a list of NSRLGs (Non-Shared Risk Link Groups). +When an abstract TE link is configured, this list specifies +the request that underlay TE paths need to be mutually +disjoint with other TE links in the same groups. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_nsrlgs.te_nsrlgs, is_container='container', yang_name="te-nsrlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_nsrlgs must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_nsrlgs.te_nsrlgs, is_container='container', yang_name="te-nsrlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_nsrlgs = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_nsrlgs(self): + self.__te_nsrlgs = YANGDynClass(base=te_nsrlgs.te_nsrlgs, is_container='container', yang_name="te-nsrlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_otn_link(self): + """ + Getter method for otn_link, mapped from YANG variable /networks/network/link/te/te_link_attributes/otn_link (container) + + YANG Description: Attributes of the OTN Link. + """ + return self.__otn_link + + def _set_otn_link(self, v, load=False): + """ + Setter method for otn_link, mapped from YANG variable /networks/network/link/te/te_link_attributes/otn_link (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn_link is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn_link() directly. + + YANG Description: Attributes of the OTN Link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn_link.otn_link, is_container='container', yang_name="otn-link", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn_link must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn_link.otn_link, is_container='container', yang_name="otn-link", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn_link = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn_link(self): + self.__otn_link = YANGDynClass(base=otn_link.otn_link, is_container='container', yang_name="otn-link", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_client_svc(self): + """ + Getter method for client_svc, mapped from YANG variable /networks/network/link/te/te_link_attributes/client_svc (container) + + YANG Description: Attributes of the Link supporting CBR client signals. + """ + return self.__client_svc + + def _set_client_svc(self, v, load=False): + """ + Setter method for client_svc, mapped from YANG variable /networks/network/link/te/te_link_attributes/client_svc (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_client_svc is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_client_svc() directly. + + YANG Description: Attributes of the Link supporting CBR client signals. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=client_svc.client_svc, is_container='container', yang_name="client-svc", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """client_svc must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=client_svc.client_svc, is_container='container', yang_name="client-svc", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__client_svc = t + if hasattr(self, '_set'): + self._set() + + def _unset_client_svc(self): + self.__client_svc = YANGDynClass(base=client_svc.client_svc, is_container='container', yang_name="client-svc", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + access_type = __builtin__.property(_get_access_type, _set_access_type) + external_domain = __builtin__.property(_get_external_domain, _set_external_domain) + is_abstract = __builtin__.property(_get_is_abstract, _set_is_abstract) + name = __builtin__.property(_get_name, _set_name) + underlay = __builtin__.property(_get_underlay, _set_underlay) + admin_status = __builtin__.property(_get_admin_status, _set_admin_status) + link_index = __builtin__.property(_get_link_index, _set_link_index) + administrative_group = __builtin__.property(_get_administrative_group, _set_administrative_group) + interface_switching_capability = __builtin__.property(_get_interface_switching_capability, _set_interface_switching_capability) + label_restrictions = __builtin__.property(_get_label_restrictions, _set_label_restrictions) + link_protection_type = __builtin__.property(_get_link_protection_type, _set_link_protection_type) + max_link_bandwidth = __builtin__.property(_get_max_link_bandwidth, _set_max_link_bandwidth) + max_resv_link_bandwidth = __builtin__.property(_get_max_resv_link_bandwidth, _set_max_resv_link_bandwidth) + unreserved_bandwidth = __builtin__.property(_get_unreserved_bandwidth, _set_unreserved_bandwidth) + te_default_metric = __builtin__.property(_get_te_default_metric, _set_te_default_metric) + te_delay_metric = __builtin__.property(_get_te_delay_metric, _set_te_delay_metric) + te_igp_metric = __builtin__.property(_get_te_igp_metric, _set_te_igp_metric) + te_srlgs = __builtin__.property(_get_te_srlgs, _set_te_srlgs) + te_nsrlgs = __builtin__.property(_get_te_nsrlgs, _set_te_nsrlgs) + otn_link = __builtin__.property(_get_otn_link, _set_otn_link) + client_svc = __builtin__.property(_get_client_svc, _set_client_svc) + + + _pyangbind_elements = OrderedDict([('access_type', access_type), ('external_domain', external_domain), ('is_abstract', is_abstract), ('name', name), ('underlay', underlay), ('admin_status', admin_status), ('link_index', link_index), ('administrative_group', administrative_group), ('interface_switching_capability', interface_switching_capability), ('label_restrictions', label_restrictions), ('link_protection_type', link_protection_type), ('max_link_bandwidth', max_link_bandwidth), ('max_resv_link_bandwidth', max_resv_link_bandwidth), ('unreserved_bandwidth', unreserved_bandwidth), ('te_default_metric', te_default_metric), ('te_delay_metric', te_delay_metric), ('te_igp_metric', te_igp_metric), ('te_srlgs', te_srlgs), ('te_nsrlgs', te_nsrlgs), ('otn_link', otn_link), ('client_svc', client_svc), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/client_svc/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/client_svc/__init__.py new file mode 100644 index 000000000..69ba52bbc --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/client_svc/__init__.py @@ -0,0 +1,115 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class client_svc(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/client-svc. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Attributes of the Link supporting CBR client signals. + """ + __slots__ = ('_path_helper', '_extmethods', '__supported_client_signal',) + + _yang_name = 'client-svc' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__supported_client_signal = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="supported-client-signal", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'client-svc'] + + def _get_supported_client_signal(self): + """ + Getter method for supported_client_signal, mapped from YANG variable /networks/network/link/te/te_link_attributes/client_svc/supported_client_signal (identityref) + + YANG Description: List of client signal types supported by the Link. + """ + return self.__supported_client_signal + + def _set_supported_client_signal(self, v, load=False): + """ + Setter method for supported_client_signal, mapped from YANG variable /networks/network/link/te/te_link_attributes/client_svc/supported_client_signal (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_supported_client_signal is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_supported_client_signal() directly. + + YANG Description: List of client signal types supported by the Link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="supported-client-signal", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """supported_client_signal must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="supported-client-signal", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__supported_client_signal = t + if hasattr(self, '_set'): + self._set() + + def _unset_supported_client_signal(self): + self.__supported_client_signal = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="supported-client-signal", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + supported_client_signal = __builtin__.property(_get_supported_client_signal, _set_supported_client_signal) + + + _pyangbind_elements = OrderedDict([('supported_client_signal', supported_client_signal), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/external_domain/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/external_domain/__init__.py new file mode 100644 index 000000000..adc0d23fb --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/external_domain/__init__.py @@ -0,0 +1,205 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class external_domain(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/external-domain. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: For an inter-domain link, specifies the attributes of +the remote end of the link, to facilitate the signaling at +the local end. + """ + __slots__ = ('_path_helper', '_extmethods', '__network_ref','__remote_te_node_id','__remote_te_link_tp_id',) + + _yang_name = 'external-domain' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + self.__remote_te_node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="remote-te-node-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-node-id', is_config=True) + self.__remote_te_link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="remote-te-link-tp-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-tp-id', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'external-domain'] + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/link/te/te_link_attributes/external_domain/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/link/te/te_link_attributes/external_domain/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + + def _get_remote_te_node_id(self): + """ + Getter method for remote_te_node_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/external_domain/remote_te_node_id (te-types:te-node-id) + + YANG Description: Remote TE node identifier, used together with +'remote-te-link-tp-id' to identify the remote Link +Termination Point (LTP) in a different domain. + """ + return self.__remote_te_node_id + + def _set_remote_te_node_id(self, v, load=False): + """ + Setter method for remote_te_node_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/external_domain/remote_te_node_id (te-types:te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_remote_te_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_remote_te_node_id() directly. + + YANG Description: Remote TE node identifier, used together with +'remote-te-link-tp-id' to identify the remote Link +Termination Point (LTP) in a different domain. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="remote-te-node-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """remote_te_node_id must be of a type compatible with te-types:te-node-id""", + 'defined-type': "te-types:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="remote-te-node-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-node-id', is_config=True)""", + }) + + self.__remote_te_node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_remote_te_node_id(self): + self.__remote_te_node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="remote-te-node-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-node-id', is_config=True) + + + def _get_remote_te_link_tp_id(self): + """ + Getter method for remote_te_link_tp_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/external_domain/remote_te_link_tp_id (te-types:te-tp-id) + + YANG Description: Remote TE LTP identifier, used together with +'remote-te-node-id' to identify the remote LTP in a +different domain. + """ + return self.__remote_te_link_tp_id + + def _set_remote_te_link_tp_id(self, v, load=False): + """ + Setter method for remote_te_link_tp_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/external_domain/remote_te_link_tp_id (te-types:te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_remote_te_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_remote_te_link_tp_id() directly. + + YANG Description: Remote TE LTP identifier, used together with +'remote-te-node-id' to identify the remote LTP in a +different domain. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="remote-te-link-tp-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """remote_te_link_tp_id must be of a type compatible with te-types:te-tp-id""", + 'defined-type': "te-types:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="remote-te-link-tp-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-tp-id', is_config=True)""", + }) + + self.__remote_te_link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_remote_te_link_tp_id(self): + self.__remote_te_link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="remote-te-link-tp-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-tp-id', is_config=True) + + network_ref = __builtin__.property(_get_network_ref, _set_network_ref) + remote_te_node_id = __builtin__.property(_get_remote_te_node_id, _set_remote_te_node_id) + remote_te_link_tp_id = __builtin__.property(_get_remote_te_link_tp_id, _set_remote_te_link_tp_id) + + + _pyangbind_elements = OrderedDict([('network_ref', network_ref), ('remote_te_node_id', remote_te_node_id), ('remote_te_link_tp_id', remote_te_link_tp_id), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/__init__.py new file mode 100644 index 000000000..e999df8fd --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/__init__.py @@ -0,0 +1,206 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import max_lsp_bandwidth +class interface_switching_capability(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/interface-switching-capability. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of ISCDs for this link. + """ + __slots__ = ('_path_helper', '_extmethods', '__switching_capability','__encoding','__max_lsp_bandwidth',) + + _yang_name = 'interface-switching-capability' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__switching_capability = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__encoding = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__max_lsp_bandwidth = YANGDynClass(base=YANGListType("priority",max_lsp_bandwidth.max_lsp_bandwidth, yang_name="max-lsp-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="max-lsp-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'interface-switching-capability'] + + def _get_switching_capability(self): + """ + Getter method for switching_capability, mapped from YANG variable /networks/network/link/te/te_link_attributes/interface_switching_capability/switching_capability (identityref) + + YANG Description: Switching capability for this interface. + """ + return self.__switching_capability + + def _set_switching_capability(self, v, load=False): + """ + Setter method for switching_capability, mapped from YANG variable /networks/network/link/te/te_link_attributes/interface_switching_capability/switching_capability (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_switching_capability is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_switching_capability() directly. + + YANG Description: Switching capability for this interface. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """switching_capability must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__switching_capability = t + if hasattr(self, '_set'): + self._set() + + def _unset_switching_capability(self): + self.__switching_capability = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_encoding(self): + """ + Getter method for encoding, mapped from YANG variable /networks/network/link/te/te_link_attributes/interface_switching_capability/encoding (identityref) + + YANG Description: Encoding supported by this interface. + """ + return self.__encoding + + def _set_encoding(self, v, load=False): + """ + Setter method for encoding, mapped from YANG variable /networks/network/link/te/te_link_attributes/interface_switching_capability/encoding (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_encoding is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_encoding() directly. + + YANG Description: Encoding supported by this interface. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """encoding must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__encoding = t + if hasattr(self, '_set'): + self._set() + + def _unset_encoding(self): + self.__encoding = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_max_lsp_bandwidth(self): + """ + Getter method for max_lsp_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth (list) + + YANG Description: Maximum Label Switched Path (LSP) bandwidth at +priorities 0-7. + """ + return self.__max_lsp_bandwidth + + def _set_max_lsp_bandwidth(self, v, load=False): + """ + Setter method for max_lsp_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_max_lsp_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_max_lsp_bandwidth() directly. + + YANG Description: Maximum Label Switched Path (LSP) bandwidth at +priorities 0-7. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("priority",max_lsp_bandwidth.max_lsp_bandwidth, yang_name="max-lsp-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="max-lsp-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """max_lsp_bandwidth must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("priority",max_lsp_bandwidth.max_lsp_bandwidth, yang_name="max-lsp-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="max-lsp-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__max_lsp_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_max_lsp_bandwidth(self): + self.__max_lsp_bandwidth = YANGDynClass(base=YANGListType("priority",max_lsp_bandwidth.max_lsp_bandwidth, yang_name="max-lsp-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="max-lsp-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + switching_capability = __builtin__.property(_get_switching_capability, _set_switching_capability) + encoding = __builtin__.property(_get_encoding, _set_encoding) + max_lsp_bandwidth = __builtin__.property(_get_max_lsp_bandwidth, _set_max_lsp_bandwidth) + + + _pyangbind_elements = OrderedDict([('switching_capability', switching_capability), ('encoding', encoding), ('max_lsp_bandwidth', max_lsp_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/__init__.py new file mode 100644 index 000000000..fd066564c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/__init__.py @@ -0,0 +1,163 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_bandwidth +class max_lsp_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/interface-switching-capability/max-lsp-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Maximum Label Switched Path (LSP) bandwidth at +priorities 0-7. + """ + __slots__ = ('_path_helper', '_extmethods', '__priority','__te_bandwidth',) + + _yang_name = 'max-lsp-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'interface-switching-capability', 'max-lsp-bandwidth'] + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/priority (uint8) + + YANG Description: Priority. + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: Priority. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + + + def _get_te_bandwidth(self): + """ + Getter method for te_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth (container) + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + return self.__te_bandwidth + + def _set_te_bandwidth(self, v, load=False): + """ + Setter method for te_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_bandwidth() directly. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_bandwidth(self): + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + priority = __builtin__.property(_get_priority, _set_priority) + te_bandwidth = __builtin__.property(_get_te_bandwidth, _set_te_bandwidth) + + + _pyangbind_elements = OrderedDict([('priority', priority), ('te_bandwidth', te_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/__init__.py new file mode 100644 index 000000000..ae1f4655b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/__init__.py @@ -0,0 +1,195 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/interface-switching-capability/max-lsp-bandwidth/te-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_bandwidth',) + + _yang_name = 'te-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'interface-switching-capability', 'max-lsp-bandwidth', 'te-bandwidth'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/generic (te-bandwidth) + + YANG Description: Bandwidth specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/generic (te-bandwidth) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Bandwidth specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with te-bandwidth""", + 'defined-type': "ietf-te-topology:te-bandwidth", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn (container) + + YANG Description: Maximum bandwidth attributes for OTN paths. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Maximum bandwidth attributes for OTN paths. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_eth_bandwidth(self): + """ + Getter method for eth_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/eth_bandwidth (uint64) + + YANG Description: Available bandwith value expressed in kilobits per second + """ + return self.__eth_bandwidth + + def _set_eth_bandwidth(self, v, load=False): + """ + Setter method for eth_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/eth_bandwidth (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_bandwidth() directly. + + YANG Description: Available bandwith value expressed in kilobits per second + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_bandwidth must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__eth_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_bandwidth(self): + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + eth_bandwidth = __builtin__.property(_get_eth_bandwidth, _set_eth_bandwidth) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['eth_bandwidth']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_bandwidth', eth_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/__init__.py new file mode 100644 index 000000000..714d3fac7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/__init__.py @@ -0,0 +1,156 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/interface-switching-capability/max-lsp-bandwidth/te-bandwidth/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Maximum bandwidth attributes for OTN paths. + """ + __slots__ = ('_path_helper', '_extmethods', '__odu_type','__max_ts_number',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__max_ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="max-ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'interface-switching-capability', 'max-lsp-bandwidth', 'te-bandwidth', 'otn'] + + def _get_odu_type(self): + """ + Getter method for odu_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/odu_type (identityref) + + YANG Description: ODU type + """ + return self.__odu_type + + def _set_odu_type(self, v, load=False): + """ + Setter method for odu_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/odu_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type() directly. + + YANG Description: ODU type + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__odu_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type(self): + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_max_ts_number(self): + """ + Getter method for max_ts_number, mapped from YANG variable /networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/max_ts_number (uint16) + + YANG Description: The maximum number of Tributary Slots (TS) that could be +used by an ODUflex LSP. + """ + return self.__max_ts_number + + def _set_max_ts_number(self, v, load=False): + """ + Setter method for max_ts_number, mapped from YANG variable /networks/network/link/te/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/max_ts_number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_max_ts_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_max_ts_number() directly. + + YANG Description: The maximum number of Tributary Slots (TS) that could be +used by an ODUflex LSP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="max-ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """max_ts_number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="max-ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__max_ts_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_max_ts_number(self): + self.__max_ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="max-ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + odu_type = __builtin__.property(_get_odu_type, _set_odu_type) + max_ts_number = __builtin__.property(_get_max_ts_number, _set_max_ts_number) + + __choices__ = {'technology': {'otn': ['odu_type', 'max_ts_number']}} + _pyangbind_elements = OrderedDict([('odu_type', odu_type), ('max_ts_number', max_ts_number), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/__init__.py new file mode 100644 index 000000000..f4e44b0e9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/__init__.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import label_restriction +class label_restrictions(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/label-restrictions. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The label restrictions container. + """ + __slots__ = ('_path_helper', '_extmethods', '__label_restriction',) + + _yang_name = 'label-restrictions' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__label_restriction = YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'label-restrictions'] + + def _get_label_restriction(self): + """ + Getter method for label_restriction, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction (list) + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + return self.__label_restriction + + def _set_label_restriction(self, v, load=False): + """ + Setter method for label_restriction, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_restriction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_restriction() directly. + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_restriction must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__label_restriction = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_restriction(self): + self.__label_restriction = YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + label_restriction = __builtin__.property(_get_label_restriction, _set_label_restriction) + + + _pyangbind_elements = OrderedDict([('label_restriction', label_restriction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/__init__.py new file mode 100644 index 000000000..44f081277 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/__init__.py @@ -0,0 +1,450 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import label_start +from . import label_end +from . import label_step +from . import otn_label_range +from . import ethernet_label_range +class label_restriction(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/label-restrictions/label-restriction. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + __slots__ = ('_path_helper', '_extmethods', '__restriction','__index','__label_start','__label_end','__label_step','__range_bitmap','__otn_label_range','__ethernet_label_range',) + + _yang_name = 'label-restriction' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__restriction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__label_start = YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_end = YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_step = YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__range_bitmap = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True) + self.__otn_label_range = YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__ethernet_label_range = YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'label-restrictions', 'label-restriction'] + + def _get_restriction(self): + """ + Getter method for restriction, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/restriction (enumeration) + + YANG Description: Indicates whether the list item is inclusive or exclusive. + """ + return self.__restriction + + def _set_restriction(self, v, load=False): + """ + Setter method for restriction, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/restriction (enumeration) + If this variable is read-only (config: false) in the + source YANG file, then _set_restriction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_restriction() directly. + + YANG Description: Indicates whether the list item is inclusive or exclusive. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """restriction must be of a type compatible with enumeration""", + 'defined-type': "ietf-te-topology:enumeration", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True)""", + }) + + self.__restriction = t + if hasattr(self, '_set'): + self._set() + + def _unset_restriction(self): + self.__restriction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/index (uint32) + + YANG Description: The index of the label restriction list entry. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/index (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: The index of the label restriction list entry. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_label_start(self): + """ + Getter method for label_start, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start (container) + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + return self.__label_start + + def _set_label_start(self, v, load=False): + """ + Setter method for label_start, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_start is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_start() directly. + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_start must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_start = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_start(self): + self.__label_start = YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_end(self): + """ + Getter method for label_end, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end (container) + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + return self.__label_end + + def _set_label_end(self, v, load=False): + """ + Setter method for label_end, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_end is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_end() directly. + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_end must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_end = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_end(self): + self.__label_end = YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_step(self): + """ + Getter method for label_step, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step (container) + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + return self.__label_step + + def _set_label_step(self, v, load=False): + """ + Setter method for label_step, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_step is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_step() directly. + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_step must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_step = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_step(self): + self.__label_step = YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_range_bitmap(self): + """ + Getter method for range_bitmap, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/range_bitmap (yang:hex-string) + + YANG Description: When there are gaps between 'label-start' and 'label-end', +this attribute is used to specify the positions +of the used labels. This is represented in big endian as +'hex-string'. +The most significant byte in the hex-string is the farthest +to the left in the byte sequence. Leading zero bytes in the +configured value may be omitted for brevity. +Each bit position in the 'range-bitmap' 'hex-string' maps +to a label in the range derived from 'label-start'. + +For example, assuming that 'label-start' = 16000 and +'range-bitmap' = 0x01000001, then: + +- bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. +- bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1. + """ + return self.__range_bitmap + + def _set_range_bitmap(self, v, load=False): + """ + Setter method for range_bitmap, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/range_bitmap (yang:hex-string) + If this variable is read-only (config: false) in the + source YANG file, then _set_range_bitmap is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_range_bitmap() directly. + + YANG Description: When there are gaps between 'label-start' and 'label-end', +this attribute is used to specify the positions +of the used labels. This is represented in big endian as +'hex-string'. +The most significant byte in the hex-string is the farthest +to the left in the byte sequence. Leading zero bytes in the +configured value may be omitted for brevity. +Each bit position in the 'range-bitmap' 'hex-string' maps +to a label in the range derived from 'label-start'. + +For example, assuming that 'label-start' = 16000 and +'range-bitmap' = 0x01000001, then: + +- bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. +- bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """range_bitmap must be of a type compatible with yang:hex-string""", + 'defined-type': "yang:hex-string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True)""", + }) + + self.__range_bitmap = t + if hasattr(self, '_set'): + self._set() + + def _unset_range_bitmap(self): + self.__range_bitmap = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True) + + + def _get_otn_label_range(self): + """ + Getter method for otn_label_range, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/otn_label_range (container) + + YANG Description: Label range information for OTN. + """ + return self.__otn_label_range + + def _set_otn_label_range(self, v, load=False): + """ + Setter method for otn_label_range, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/otn_label_range (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn_label_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn_label_range() directly. + + YANG Description: Label range information for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn_label_range must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn_label_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn_label_range(self): + self.__otn_label_range = YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_ethernet_label_range(self): + """ + Getter method for ethernet_label_range, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/ethernet_label_range (container) + + YANG Description: Ethernet-specific label range related information. + """ + return self.__ethernet_label_range + + def _set_ethernet_label_range(self, v, load=False): + """ + Setter method for ethernet_label_range, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/ethernet_label_range (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_ethernet_label_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ethernet_label_range() directly. + + YANG Description: Ethernet-specific label range related information. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ethernet_label_range must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True)""", + }) + + self.__ethernet_label_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_ethernet_label_range(self): + self.__ethernet_label_range = YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + restriction = __builtin__.property(_get_restriction, _set_restriction) + index = __builtin__.property(_get_index, _set_index) + label_start = __builtin__.property(_get_label_start, _set_label_start) + label_end = __builtin__.property(_get_label_end, _set_label_end) + label_step = __builtin__.property(_get_label_step, _set_label_step) + range_bitmap = __builtin__.property(_get_range_bitmap, _set_range_bitmap) + otn_label_range = __builtin__.property(_get_otn_label_range, _set_otn_label_range) + ethernet_label_range = __builtin__.property(_get_ethernet_label_range, _set_ethernet_label_range) + + + _pyangbind_elements = OrderedDict([('restriction', restriction), ('index', index), ('label_start', label_start), ('label_end', label_end), ('label_step', label_step), ('range_bitmap', range_bitmap), ('otn_label_range', otn_label_range), ('ethernet_label_range', ethernet_label_range), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/ethernet_label_range/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/ethernet_label_range/__init__.py new file mode 100644 index 000000000..52e6a65c1 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/ethernet_label_range/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class ethernet_label_range(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/label-restrictions/label-restriction/ethernet-label-range. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Ethernet-specific label range related information. + """ + __slots__ = ('_path_helper', '_extmethods', '__tag_type','__priority',) + + _yang_name = 'ethernet-label-range' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tag_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'label-restrictions', 'label-restriction', 'ethernet-label-range'] + + def _get_tag_type(self): + """ + Getter method for tag_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/ethernet_label_range/tag_type (etht-types:eth-tag-type) + + YANG Description: VLAN tag type. + """ + return self.__tag_type + + def _set_tag_type(self, v, load=False): + """ + Setter method for tag_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/ethernet_label_range/tag_type (etht-types:eth-tag-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_tag_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tag_type() directly. + + YANG Description: VLAN tag type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tag_type must be of a type compatible with etht-types:eth-tag-type""", + 'defined-type': "etht-types:eth-tag-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True)""", + }) + + self.__tag_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_tag_type(self): + self.__tag_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/ethernet_label_range/priority (uint8) + + YANG Description: priority. + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/ethernet_label_range/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: priority. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True) + + tag_type = __builtin__.property(_get_tag_type, _set_tag_type) + priority = __builtin__.property(_get_priority, _set_priority) + + + _pyangbind_elements = OrderedDict([('tag_type', tag_type), ('priority', priority), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/__init__.py new file mode 100644 index 000000000..ac25e0634 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/__init__.py @@ -0,0 +1,119 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_end(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/label-restrictions/label-restriction/label-end. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-end' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'label-restrictions', 'label-restriction', 'label-end'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/__init__.py new file mode 100644 index 000000000..67dde9052 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/label-restrictions/label-restriction/label-end/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'label-restrictions', 'label-restriction', 'label-end', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/otn (container) + + YANG Description: Label start or label end for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label start or label end for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py new file mode 100644 index 000000000..24875829b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/label-restrictions/label-restriction/label-end/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label start or label end for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'label-restrictions', 'label-restriction', 'label-end', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/otn/ts (otn-ts) + + YANG Description: Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + ts = __builtin__.property(_get_ts, _set_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/__init__.py new file mode 100644 index 000000000..65fb7f8e1 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/__init__.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_start(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/label-restrictions/label-restriction/label-start. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-start' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'label-restrictions', 'label-restriction', 'label-start'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/__init__.py new file mode 100644 index 000000000..4a68961e3 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/label-restrictions/label-restriction/label-start/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'label-restrictions', 'label-restriction', 'label-start', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/otn (container) + + YANG Description: Label start or label end for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label start or label end for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py new file mode 100644 index 000000000..082f89723 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/label-restrictions/label-restriction/label-start/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label start or label end for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'label-restrictions', 'label-restriction', 'label-start', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/otn/ts (otn-ts) + + YANG Description: Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + ts = __builtin__.property(_get_ts, _set_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/__init__.py new file mode 100644 index 000000000..51201035a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/__init__.py @@ -0,0 +1,200 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class label_step(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/label-restrictions/label-restriction/label-step. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_step',) + + _yang_name = 'label-step' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__eth_step = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'label-restrictions', 'label-restriction', 'label-step'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/generic (int32) + + YANG Description: Label range step. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/generic (int32) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Label range step. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with int32""", + 'defined-type': "int32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/otn (container) + + YANG Description: Label step for OTN + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label step for OTN + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_eth_step(self): + """ + Getter method for eth_step, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/eth_step (uint16) + + YANG Description: Label step which represent possible increments for +an Ethernet VLAN tag. + """ + return self.__eth_step + + def _set_eth_step(self, v, load=False): + """ + Setter method for eth_step, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/eth_step (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_step is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_step() directly. + + YANG Description: Label step which represent possible increments for +an Ethernet VLAN tag. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_step must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True)""", + }) + + self.__eth_step = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_step(self): + self.__eth_step = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + eth_step = __builtin__.property(_get_eth_step, _set_eth_step) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['eth_step']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_step', eth_step), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/otn/__init__.py new file mode 100644 index 000000000..1325a1afd --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/otn/__init__.py @@ -0,0 +1,158 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/label-restrictions/label-restriction/label-step/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label step for OTN + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'label-restrictions', 'label-restriction', 'label-step', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/otn/tpn (otn-tpn) + + YANG Description: Label step which represents possible increments for +Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Label step which represents possible increments for +Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/otn/ts (otn-ts) + + YANG Description: Label step which represents possible increments for +Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/label_step/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Label step which represents possible increments for +Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + ts = __builtin__.property(_get_ts, _set_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/otn_label_range/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/otn_label_range/__init__.py new file mode 100644 index 000000000..b59c995b2 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/otn_label_range/__init__.py @@ -0,0 +1,256 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn_label_range(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/label-restrictions/label-restriction/otn-label-range. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label range information for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__range_type','__tsg','__odu_type_list','__priority',) + + _yang_name = 'otn-label-range' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__range_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__odu_type_list = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'label-restrictions', 'label-restriction', 'otn-label-range'] + + def _get_range_type(self): + """ + Getter method for range_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/otn_label_range/range_type (otn-label-range-type) + + YANG Description: The type of range (e.g., TPN or TS) +to which the label range applies + """ + return self.__range_type + + def _set_range_type(self, v, load=False): + """ + Setter method for range_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/otn_label_range/range_type (otn-label-range-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_range_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_range_type() directly. + + YANG Description: The type of range (e.g., TPN or TS) +to which the label range applies + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """range_type must be of a type compatible with otn-label-range-type""", + 'defined-type': "ietf-otn-topology:otn-label-range-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True)""", + }) + + self.__range_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_range_type(self): + self.__range_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/otn_label_range/tsg (identityref) + + YANG Description: Tributary slot granularity (TSG) to which the label range +applies. + +This leaf MUST be present when the range-type is TS. + +This leaf MAY be omitted when mapping an ODUk over an OTUk +Link. In this case the range-type is tpn, with only one +entry (ODUk), and the tpn range has only one value (1). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/otn_label_range/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary slot granularity (TSG) to which the label range +applies. + +This leaf MUST be present when the range-type is TS. + +This leaf MAY be omitted when mapping an ODUk over an OTUk +Link. In this case the range-type is tpn, with only one +entry (ODUk), and the tpn range has only one value (1). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_odu_type_list(self): + """ + Getter method for odu_type_list, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/otn_label_range/odu_type_list (identityref) + + YANG Description: List of ODU types to which the label range applies. + +An Empty odu-type-list means that the label range +applies to all the supported ODU types. + """ + return self.__odu_type_list + + def _set_odu_type_list(self, v, load=False): + """ + Setter method for odu_type_list, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/otn_label_range/odu_type_list (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type_list() directly. + + YANG Description: List of ODU types to which the label range applies. + +An Empty odu-type-list means that the label range +applies to all the supported ODU types. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type_list must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__odu_type_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type_list(self): + self.__odu_type_list = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/otn_label_range/priority (uint8) + + YANG Description: Priority in Interface Switching Capability +Descriptor (ISCD). + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/link/te/te_link_attributes/label_restrictions/label_restriction/otn_label_range/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: Priority in Interface Switching Capability +Descriptor (ISCD). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True) + + range_type = __builtin__.property(_get_range_type, _set_range_type) + tsg = __builtin__.property(_get_tsg, _set_tsg) + odu_type_list = __builtin__.property(_get_odu_type_list, _set_odu_type_list) + priority = __builtin__.property(_get_priority, _set_priority) + + + _pyangbind_elements = OrderedDict([('range_type', range_type), ('tsg', tsg), ('odu_type_list', odu_type_list), ('priority', priority), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_link_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_link_bandwidth/__init__.py new file mode 100644 index 000000000..566cf7799 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_link_bandwidth/__init__.py @@ -0,0 +1,119 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_bandwidth +class max_link_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/max-link-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Maximum bandwidth that can be seen on this link in this +direction. Units are in bytes per second. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_bandwidth',) + + _yang_name = 'max-link-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'max-link-bandwidth'] + + def _get_te_bandwidth(self): + """ + Getter method for te_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth (container) + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + return self.__te_bandwidth + + def _set_te_bandwidth(self, v, load=False): + """ + Setter method for te_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_bandwidth() directly. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_bandwidth(self): + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_bandwidth = __builtin__.property(_get_te_bandwidth, _set_te_bandwidth) + + + _pyangbind_elements = OrderedDict([('te_bandwidth', te_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/__init__.py new file mode 100644 index 000000000..c0e0c9a78 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/__init__.py @@ -0,0 +1,195 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/max-link-bandwidth/te-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_bandwidth',) + + _yang_name = 'te-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'max-link-bandwidth', 'te-bandwidth'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/generic (te-bandwidth) + + YANG Description: Bandwidth specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/generic (te-bandwidth) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Bandwidth specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with te-bandwidth""", + 'defined-type': "ietf-te-topology:te-bandwidth", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/otn (container) + + YANG Description: Bandwidth attributes for OTN links + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Bandwidth attributes for OTN links + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_eth_bandwidth(self): + """ + Getter method for eth_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/eth_bandwidth (uint64) + + YANG Description: Available bandwith value expressed in kilobits per second + """ + return self.__eth_bandwidth + + def _set_eth_bandwidth(self, v, load=False): + """ + Setter method for eth_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/eth_bandwidth (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_bandwidth() directly. + + YANG Description: Available bandwith value expressed in kilobits per second + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_bandwidth must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__eth_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_bandwidth(self): + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + eth_bandwidth = __builtin__.property(_get_eth_bandwidth, _set_eth_bandwidth) + + __choices__ = {'technology': {'generic': ['generic']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_bandwidth', eth_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/__init__.py new file mode 100644 index 000000000..94132f930 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import odulist +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/max-link-bandwidth/te-bandwidth/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Bandwidth attributes for OTN links + """ + __slots__ = ('_path_helper', '_extmethods', '__odulist',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'max-link-bandwidth', 'te-bandwidth', 'otn'] + + def _get_odulist(self): + """ + Getter method for odulist, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist (list) + + YANG Description: OTN bandwidth definition + """ + return self.__odulist + + def _set_odulist(self, v, load=False): + """ + Setter method for odulist, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_odulist is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odulist() directly. + + YANG Description: OTN bandwidth definition + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odulist must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True)""", + }) + + self.__odulist = t + if hasattr(self, '_set'): + self._set() + + def _unset_odulist(self): + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + + odulist = __builtin__.property(_get_odulist, _set_odulist) + + + _pyangbind_elements = OrderedDict([('odulist', odulist), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist/__init__.py new file mode 100644 index 000000000..53a6ab873 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist/__init__.py @@ -0,0 +1,200 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class odulist(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/max-link-bandwidth/te-bandwidth/otn/odulist. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: OTN bandwidth definition + """ + __slots__ = ('_path_helper', '_extmethods', '__odu_type','__number','__ts_number',) + + _yang_name = 'odulist' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'max-link-bandwidth', 'te-bandwidth', 'otn', 'odulist'] + + def _get_odu_type(self): + """ + Getter method for odu_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist/odu_type (identityref) + + YANG Description: ODU type + """ + return self.__odu_type + + def _set_odu_type(self, v, load=False): + """ + Setter method for odu_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist/odu_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type() directly. + + YANG Description: ODU type + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__odu_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type(self): + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_number(self): + """ + Getter method for number, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist/number (uint16) + + YANG Description: Number of ODUs + """ + return self.__number + + def _set_number(self, v, load=False): + """ + Setter method for number, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist/number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_number() directly. + + YANG Description: Number of ODUs + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__number = t + if hasattr(self, '_set'): + self._set() + + def _unset_number(self): + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + + def _get_ts_number(self): + """ + Getter method for ts_number, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist/ts_number (uint16) + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + return self.__ts_number + + def _set_ts_number(self, v, load=False): + """ + Setter method for ts_number, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist/ts_number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_number() directly. + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__ts_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_number(self): + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + odu_type = __builtin__.property(_get_odu_type, _set_odu_type) + number = __builtin__.property(_get_number, _set_number) + ts_number = __builtin__.property(_get_ts_number, _set_ts_number) + + + _pyangbind_elements = OrderedDict([('odu_type', odu_type), ('number', number), ('ts_number', ts_number), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/__init__.py new file mode 100644 index 000000000..33d25351b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/__init__.py @@ -0,0 +1,119 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_bandwidth +class max_resv_link_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/max-resv-link-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Maximum amount of bandwidth that can be reserved in this +direction in this link. Units are in bytes per second. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_bandwidth',) + + _yang_name = 'max-resv-link-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'max-resv-link-bandwidth'] + + def _get_te_bandwidth(self): + """ + Getter method for te_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth (container) + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + return self.__te_bandwidth + + def _set_te_bandwidth(self, v, load=False): + """ + Setter method for te_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_bandwidth() directly. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_bandwidth(self): + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_bandwidth = __builtin__.property(_get_te_bandwidth, _set_te_bandwidth) + + + _pyangbind_elements = OrderedDict([('te_bandwidth', te_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/__init__.py new file mode 100644 index 000000000..34072dafa --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/__init__.py @@ -0,0 +1,195 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/max-resv-link-bandwidth/te-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_bandwidth',) + + _yang_name = 'te-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'max-resv-link-bandwidth', 'te-bandwidth'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/generic (te-bandwidth) + + YANG Description: Bandwidth specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/generic (te-bandwidth) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Bandwidth specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with te-bandwidth""", + 'defined-type': "ietf-te-topology:te-bandwidth", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn (container) + + YANG Description: Bandwidth attributes for OTN links + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Bandwidth attributes for OTN links + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_eth_bandwidth(self): + """ + Getter method for eth_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/eth_bandwidth (uint64) + + YANG Description: Available bandwith value expressed in kilobits per second + """ + return self.__eth_bandwidth + + def _set_eth_bandwidth(self, v, load=False): + """ + Setter method for eth_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/eth_bandwidth (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_bandwidth() directly. + + YANG Description: Available bandwith value expressed in kilobits per second + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_bandwidth must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__eth_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_bandwidth(self): + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + eth_bandwidth = __builtin__.property(_get_eth_bandwidth, _set_eth_bandwidth) + + __choices__ = {'technology': {'generic': ['generic']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_bandwidth', eth_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/__init__.py new file mode 100644 index 000000000..971708460 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import odulist +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/max-resv-link-bandwidth/te-bandwidth/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Bandwidth attributes for OTN links + """ + __slots__ = ('_path_helper', '_extmethods', '__odulist',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'max-resv-link-bandwidth', 'te-bandwidth', 'otn'] + + def _get_odulist(self): + """ + Getter method for odulist, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist (list) + + YANG Description: OTN bandwidth definition + """ + return self.__odulist + + def _set_odulist(self, v, load=False): + """ + Setter method for odulist, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_odulist is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odulist() directly. + + YANG Description: OTN bandwidth definition + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odulist must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True)""", + }) + + self.__odulist = t + if hasattr(self, '_set'): + self._set() + + def _unset_odulist(self): + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + + odulist = __builtin__.property(_get_odulist, _set_odulist) + + + _pyangbind_elements = OrderedDict([('odulist', odulist), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist/__init__.py new file mode 100644 index 000000000..8ee145707 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist/__init__.py @@ -0,0 +1,200 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class odulist(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/max-resv-link-bandwidth/te-bandwidth/otn/odulist. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: OTN bandwidth definition + """ + __slots__ = ('_path_helper', '_extmethods', '__odu_type','__number','__ts_number',) + + _yang_name = 'odulist' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'max-resv-link-bandwidth', 'te-bandwidth', 'otn', 'odulist'] + + def _get_odu_type(self): + """ + Getter method for odu_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist/odu_type (identityref) + + YANG Description: ODU type + """ + return self.__odu_type + + def _set_odu_type(self, v, load=False): + """ + Setter method for odu_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist/odu_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type() directly. + + YANG Description: ODU type + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__odu_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type(self): + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_number(self): + """ + Getter method for number, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist/number (uint16) + + YANG Description: Number of ODUs + """ + return self.__number + + def _set_number(self, v, load=False): + """ + Setter method for number, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist/number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_number() directly. + + YANG Description: Number of ODUs + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__number = t + if hasattr(self, '_set'): + self._set() + + def _unset_number(self): + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + + def _get_ts_number(self): + """ + Getter method for ts_number, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist/ts_number (uint16) + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + return self.__ts_number + + def _set_ts_number(self, v, load=False): + """ + Setter method for ts_number, mapped from YANG variable /networks/network/link/te/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist/ts_number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_number() directly. + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__ts_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_number(self): + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + odu_type = __builtin__.property(_get_odu_type, _set_odu_type) + number = __builtin__.property(_get_number, _set_number) + ts_number = __builtin__.property(_get_ts_number, _set_ts_number) + + + _pyangbind_elements = OrderedDict([('odu_type', odu_type), ('number', number), ('ts_number', ts_number), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/otn_link/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/otn_link/__init__.py new file mode 100644 index 000000000..62dec2b89 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/otn_link/__init__.py @@ -0,0 +1,199 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn_link(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/otn-link. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Attributes of the OTN Link. + """ + __slots__ = ('_path_helper', '_extmethods', '__odtu_flex_type','__tsg','__distance',) + + _yang_name = 'otn-link' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odtu_flex_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__distance = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="distance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint32', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'otn-link'] + + def _get_odtu_flex_type(self): + """ + Getter method for odtu_flex_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/otn_link/odtu_flex_type (l1-types:odtu-flex-type) + + YANG Description: The type of Optical Data Tributary Unit (ODTU) +whose nominal bitrate is used to compute the number of +Tributary Slots (TS) required by the ODUflex LSPs set up +on this OTN Link. + """ + return self.__odtu_flex_type + + def _set_odtu_flex_type(self, v, load=False): + """ + Setter method for odtu_flex_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/otn_link/odtu_flex_type (l1-types:odtu-flex-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_odtu_flex_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odtu_flex_type() directly. + + YANG Description: The type of Optical Data Tributary Unit (ODTU) +whose nominal bitrate is used to compute the number of +Tributary Slots (TS) required by the ODUflex LSPs set up +on this OTN Link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odtu_flex_type must be of a type compatible with l1-types:odtu-flex-type""", + 'defined-type': "l1-types:odtu-flex-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True)""", + }) + + self.__odtu_flex_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odtu_flex_type(self): + self.__odtu_flex_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/link/te/te_link_attributes/otn_link/tsg (identityref) + + YANG Description: Tributary slot granularity. + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/link/te/te_link_attributes/otn_link/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary slot granularity. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_distance(self): + """ + Getter method for distance, mapped from YANG variable /networks/network/link/te/te_link_attributes/otn_link/distance (uint32) + + YANG Description: distance in the unit of kilometers + """ + return self.__distance + + def _set_distance(self, v, load=False): + """ + Setter method for distance, mapped from YANG variable /networks/network/link/te/te_link_attributes/otn_link/distance (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_distance is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_distance() directly. + + YANG Description: distance in the unit of kilometers + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="distance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """distance must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="distance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint32', is_config=True)""", + }) + + self.__distance = t + if hasattr(self, '_set'): + self._set() + + def _unset_distance(self): + self.__distance = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="distance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint32', is_config=True) + + odtu_flex_type = __builtin__.property(_get_odtu_flex_type, _set_odtu_flex_type) + tsg = __builtin__.property(_get_tsg, _set_tsg) + distance = __builtin__.property(_get_distance, _set_distance) + + + _pyangbind_elements = OrderedDict([('odtu_flex_type', odtu_flex_type), ('tsg', tsg), ('distance', distance), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/te_nsrlgs/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/te_nsrlgs/__init__.py new file mode 100644 index 000000000..51926d313 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/te_nsrlgs/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class te_nsrlgs(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/te-nsrlgs. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains a list of NSRLGs (Non-Shared Risk Link Groups). +When an abstract TE link is configured, this list specifies +the request that underlay TE paths need to be mutually +disjoint with other TE links in the same groups. + """ + __slots__ = ('_path_helper', '_extmethods', '__id',) + + _yang_name = 'te-nsrlgs' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__id = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'te-nsrlgs'] + + def _get_id(self): + """ + Getter method for id, mapped from YANG variable /networks/network/link/te/te_link_attributes/te_nsrlgs/id (uint32) + + YANG Description: NSRLG ID, uniquely configured within a topology. + """ + return self.__id + + def _set_id(self, v, load=False): + """ + Setter method for id, mapped from YANG variable /networks/network/link/te/te_link_attributes/te_nsrlgs/id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_id() directly. + + YANG Description: NSRLG ID, uniquely configured within a topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """id must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__id = t + if hasattr(self, '_set'): + self._set() + + def _unset_id(self): + self.__id = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + id = __builtin__.property(_get_id, _set_id) + + + _pyangbind_elements = OrderedDict([('id', id), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/te_srlgs/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/te_srlgs/__init__.py new file mode 100644 index 000000000..92ac61644 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/te_srlgs/__init__.py @@ -0,0 +1,115 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class te_srlgs(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/te-srlgs. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains a list of SRLGs. + """ + __slots__ = ('_path_helper', '_extmethods', '__value',) + + _yang_name = 'te-srlgs' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__value = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:srlg', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'te-srlgs'] + + def _get_value(self): + """ + Getter method for value, mapped from YANG variable /networks/network/link/te/te_link_attributes/te_srlgs/value (te-types:srlg) + + YANG Description: SRLG value. + """ + return self.__value + + def _set_value(self, v, load=False): + """ + Setter method for value, mapped from YANG variable /networks/network/link/te/te_link_attributes/te_srlgs/value (te-types:srlg) + If this variable is read-only (config: false) in the + source YANG file, then _set_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_value() directly. + + YANG Description: SRLG value. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:srlg', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """value must be of a type compatible with te-types:srlg""", + 'defined-type': "te-types:srlg", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:srlg', is_config=True)""", + }) + + self.__value = t + if hasattr(self, '_set'): + self._set() + + def _unset_value(self): + self.__value = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:srlg', is_config=True) + + value = __builtin__.property(_get_value, _set_value) + + + _pyangbind_elements = OrderedDict([('value', value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/__init__.py new file mode 100644 index 000000000..129490e77 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/__init__.py @@ -0,0 +1,326 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import primary_path +from . import backup_path +from . import tunnel_termination_points +from . import tunnels +class underlay(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/underlay. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Attributes of the TE link underlay. + """ + __slots__ = ('_path_helper', '_extmethods', '__enabled','__primary_path','__backup_path','__protection_type','__tunnel_termination_points','__tunnels',) + + _yang_name = 'underlay' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__enabled = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + self.__primary_path = YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__backup_path = YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + self.__protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__tunnel_termination_points = YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__tunnels = YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'underlay'] + + def _get_enabled(self): + """ + Getter method for enabled, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/enabled (boolean) + + YANG Description: 'true' if the underlay is enabled. +'false' if the underlay is disabled. + """ + return self.__enabled + + def _set_enabled(self, v, load=False): + """ + Setter method for enabled, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/enabled (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_enabled is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_enabled() directly. + + YANG Description: 'true' if the underlay is enabled. +'false' if the underlay is disabled. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """enabled must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__enabled = t + if hasattr(self, '_set'): + self._set() + + def _unset_enabled(self): + self.__enabled = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + + def _get_primary_path(self): + """ + Getter method for primary_path, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path (container) + + YANG Description: The service path on the underlay topology that +supports this link. + """ + return self.__primary_path + + def _set_primary_path(self, v, load=False): + """ + Setter method for primary_path, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_primary_path is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_primary_path() directly. + + YANG Description: The service path on the underlay topology that +supports this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """primary_path must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__primary_path = t + if hasattr(self, '_set'): + self._set() + + def _unset_primary_path(self): + self.__primary_path = YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_backup_path(self): + """ + Getter method for backup_path, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path (list) + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + return self.__backup_path + + def _set_backup_path(self, v, load=False): + """ + Setter method for backup_path, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_backup_path is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_backup_path() directly. + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """backup_path must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__backup_path = t + if hasattr(self, '_set'): + self._set() + + def _unset_backup_path(self): + self.__backup_path = YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + + def _get_protection_type(self): + """ + Getter method for protection_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/protection_type (identityref) + + YANG Description: Underlay protection type desired for this link. + """ + return self.__protection_type + + def _set_protection_type(self, v, load=False): + """ + Setter method for protection_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/protection_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_protection_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_protection_type() directly. + + YANG Description: Underlay protection type desired for this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """protection_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__protection_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_protection_type(self): + self.__protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_tunnel_termination_points(self): + """ + Getter method for tunnel_termination_points, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/tunnel_termination_points (container) + + YANG Description: Underlay TTPs desired for this link. + """ + return self.__tunnel_termination_points + + def _set_tunnel_termination_points(self, v, load=False): + """ + Setter method for tunnel_termination_points, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/tunnel_termination_points (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel_termination_points is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel_termination_points() directly. + + YANG Description: Underlay TTPs desired for this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel_termination_points must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__tunnel_termination_points = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel_termination_points(self): + self.__tunnel_termination_points = YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_tunnels(self): + """ + Getter method for tunnels, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/tunnels (container) + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + return self.__tunnels + + def _set_tunnels(self, v, load=False): + """ + Setter method for tunnels, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/tunnels (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnels is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnels() directly. + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnels must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__tunnels = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnels(self): + self.__tunnels = YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + enabled = __builtin__.property(_get_enabled, _set_enabled) + primary_path = __builtin__.property(_get_primary_path, _set_primary_path) + backup_path = __builtin__.property(_get_backup_path, _set_backup_path) + protection_type = __builtin__.property(_get_protection_type, _set_protection_type) + tunnel_termination_points = __builtin__.property(_get_tunnel_termination_points, _set_tunnel_termination_points) + tunnels = __builtin__.property(_get_tunnels, _set_tunnels) + + + _pyangbind_elements = OrderedDict([('enabled', enabled), ('primary_path', primary_path), ('backup_path', backup_path), ('protection_type', protection_type), ('tunnel_termination_points', tunnel_termination_points), ('tunnels', tunnels), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/__init__.py new file mode 100644 index 000000000..6e430aedb --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/__init__.py @@ -0,0 +1,207 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_element +class backup_path(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/underlay/backup-path. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__network_ref','__path_element',) + + _yang_name = 'backup-path' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'underlay', 'backup-path'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/index (uint32) + + YANG Description: A sequence number to identify a backup path. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/index (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: A sequence number to identify a backup path. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + + def _get_path_element(self): + """ + Getter method for path_element, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element (list) + + YANG Description: A list of path elements describing the backup service +path. + """ + return self.__path_element + + def _set_path_element(self, v, load=False): + """ + Setter method for path_element, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element() directly. + + YANG Description: A list of path elements describing the backup service +path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_element = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element(self): + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + index = __builtin__.property(_get_index, _set_index) + network_ref = __builtin__.property(_get_network_ref, _set_network_ref) + path_element = __builtin__.property(_get_path_element, _set_path_element) + + + _pyangbind_elements = OrderedDict([('index', index), ('network_ref', network_ref), ('path_element', path_element), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/__init__.py new file mode 100644 index 000000000..aca211807 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/__init__.py @@ -0,0 +1,321 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class path_element(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/underlay/backup-path/path-element. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of path elements describing the backup service +path. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_element_id','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'path-element' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'underlay', 'backup-path', 'path-element'] + + def _get_path_element_id(self): + """ + Getter method for path_element_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/path_element_id (uint32) + + YANG Description: To identify the element in a path. + """ + return self.__path_element_id + + def _set_path_element_id(self, v, load=False): + """ + Setter method for path_element_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/path_element_id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element_id() directly. + + YANG Description: To identify the element in a path. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element_id must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__path_element_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element_id(self): + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + path_element_id = __builtin__.property(_get_path_element_id, _set_path_element_id) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop, _set_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop, _set_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop, _set_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop, _set_as_number_hop) + label_hop = __builtin__.property(_get_label_hop, _set_label_hop) + + __choices__ = {'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('path_element_id', path_element_id), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/as_number_hop/__init__.py new file mode 100644 index 000000000..361309573 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/underlay/backup-path/path-element/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'underlay', 'backup-path', 'path-element', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + as_number = __builtin__.property(_get_as_number, _set_as_number) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/__init__.py new file mode 100644 index 000000000..b9ec35dbe --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/underlay/backup-path/path-element/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'underlay', 'backup-path', 'path-element', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/__init__.py new file mode 100644 index 000000000..4e91ab131 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/underlay/backup-path/path-element/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'underlay', 'backup-path', 'path-element', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py new file mode 100644 index 000000000..fb2e02afe --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/underlay/backup-path/path-element/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'underlay', 'backup-path', 'path-element', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + tsg = __builtin__.property(_get_tsg, _set_tsg) + ts_list = __builtin__.property(_get_ts_list, _set_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop/__init__.py new file mode 100644 index 000000000..06923495d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/underlay/backup-path/path-element/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'underlay', 'backup-path', 'path-element', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/numbered_node_hop/__init__.py new file mode 100644 index 000000000..246878177 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/underlay/backup-path/path-element/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'underlay', 'backup-path', 'path-element', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/numbered_node_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py new file mode 100644 index 000000000..7b040726e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/underlay/backup-path/path-element/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'underlay', 'backup-path', 'path-element', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/__init__.py new file mode 100644 index 000000000..2cbefb38a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/__init__.py @@ -0,0 +1,158 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_element +class primary_path(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/underlay/primary-path. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The service path on the underlay topology that +supports this link. + """ + __slots__ = ('_path_helper', '_extmethods', '__network_ref','__path_element',) + + _yang_name = 'primary-path' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'underlay', 'primary-path'] + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + + def _get_path_element(self): + """ + Getter method for path_element, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element (list) + + YANG Description: A list of path elements describing the service path. + """ + return self.__path_element + + def _set_path_element(self, v, load=False): + """ + Setter method for path_element, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element() directly. + + YANG Description: A list of path elements describing the service path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_element = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element(self): + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + network_ref = __builtin__.property(_get_network_ref, _set_network_ref) + path_element = __builtin__.property(_get_path_element, _set_path_element) + + + _pyangbind_elements = OrderedDict([('network_ref', network_ref), ('path_element', path_element), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/__init__.py new file mode 100644 index 000000000..d1f9ba7c6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/__init__.py @@ -0,0 +1,320 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class path_element(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/underlay/primary-path/path-element. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of path elements describing the service path. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_element_id','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'path-element' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'underlay', 'primary-path', 'path-element'] + + def _get_path_element_id(self): + """ + Getter method for path_element_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/path_element_id (uint32) + + YANG Description: To identify the element in a path. + """ + return self.__path_element_id + + def _set_path_element_id(self, v, load=False): + """ + Setter method for path_element_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/path_element_id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element_id() directly. + + YANG Description: To identify the element in a path. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element_id must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__path_element_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element_id(self): + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + path_element_id = __builtin__.property(_get_path_element_id, _set_path_element_id) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop, _set_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop, _set_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop, _set_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop, _set_as_number_hop) + label_hop = __builtin__.property(_get_label_hop, _set_label_hop) + + __choices__ = {'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('path_element_id', path_element_id), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/as_number_hop/__init__.py new file mode 100644 index 000000000..be898e3aa --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/underlay/primary-path/path-element/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'underlay', 'primary-path', 'path-element', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + as_number = __builtin__.property(_get_as_number, _set_as_number) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/__init__.py new file mode 100644 index 000000000..46d140192 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/underlay/primary-path/path-element/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'underlay', 'primary-path', 'path-element', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/__init__.py new file mode 100644 index 000000000..3aee6e73b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/underlay/primary-path/path-element/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'underlay', 'primary-path', 'path-element', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py new file mode 100644 index 000000000..30e2c479a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/underlay/primary-path/path-element/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'underlay', 'primary-path', 'path-element', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + tsg = __builtin__.property(_get_tsg, _set_tsg) + ts_list = __builtin__.property(_get_ts_list, _set_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop/__init__.py new file mode 100644 index 000000000..88d8af789 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/underlay/primary-path/path-element/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'underlay', 'primary-path', 'path-element', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/numbered_node_hop/__init__.py new file mode 100644 index 000000000..fe386ce02 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/underlay/primary-path/path-element/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'underlay', 'primary-path', 'path-element', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/numbered_node_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py new file mode 100644 index 000000000..130901543 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/underlay/primary-path/path-element/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'underlay', 'primary-path', 'path-element', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/tunnel_termination_points/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/tunnel_termination_points/__init__.py new file mode 100644 index 000000000..6b516827d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/tunnel_termination_points/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class tunnel_termination_points(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/underlay/tunnel-termination-points. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Underlay TTPs desired for this link. + """ + __slots__ = ('_path_helper', '_extmethods', '__source','__destination',) + + _yang_name = 'tunnel-termination-points' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__source = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + self.__destination = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'underlay', 'tunnel-termination-points'] + + def _get_source(self): + """ + Getter method for source, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/tunnel_termination_points/source (binary) + + YANG Description: Source TTP identifier. + """ + return self.__source + + def _set_source(self, v, load=False): + """ + Setter method for source, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/tunnel_termination_points/source (binary) + If this variable is read-only (config: false) in the + source YANG file, then _set_source is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_source() directly. + + YANG Description: Source TTP identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """source must be of a type compatible with binary""", + 'defined-type': "binary", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True)""", + }) + + self.__source = t + if hasattr(self, '_set'): + self._set() + + def _unset_source(self): + self.__source = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + + + def _get_destination(self): + """ + Getter method for destination, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/tunnel_termination_points/destination (binary) + + YANG Description: Destination TTP identifier. + """ + return self.__destination + + def _set_destination(self, v, load=False): + """ + Setter method for destination, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/tunnel_termination_points/destination (binary) + If this variable is read-only (config: false) in the + source YANG file, then _set_destination is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_destination() directly. + + YANG Description: Destination TTP identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """destination must be of a type compatible with binary""", + 'defined-type': "binary", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True)""", + }) + + self.__destination = t + if hasattr(self, '_set'): + self._set() + + def _unset_destination(self): + self.__destination = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + + source = __builtin__.property(_get_source, _set_source) + destination = __builtin__.property(_get_destination, _set_destination) + + + _pyangbind_elements = OrderedDict([('source', source), ('destination', destination), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/tunnels/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/tunnels/__init__.py new file mode 100644 index 000000000..4402db40e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/tunnels/__init__.py @@ -0,0 +1,167 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import tunnel +class tunnels(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/underlay/tunnels. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + __slots__ = ('_path_helper', '_extmethods', '__sharing','__tunnel',) + + _yang_name = 'tunnels' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__sharing = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + self.__tunnel = YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'underlay', 'tunnels'] + + def _get_sharing(self): + """ + Getter method for sharing, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/tunnels/sharing (boolean) + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. +This leaf is the default option for all TE tunnels +and may be overridden by the per-TE-tunnel value. + """ + return self.__sharing + + def _set_sharing(self, v, load=False): + """ + Setter method for sharing, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/tunnels/sharing (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_sharing is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_sharing() directly. + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. +This leaf is the default option for all TE tunnels +and may be overridden by the per-TE-tunnel value. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """sharing must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__sharing = t + if hasattr(self, '_set'): + self._set() + + def _unset_sharing(self): + self.__sharing = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + + def _get_tunnel(self): + """ + Getter method for tunnel, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/tunnels/tunnel (list) + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + return self.__tunnel + + def _set_tunnel(self, v, load=False): + """ + Setter method for tunnel, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/tunnels/tunnel (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel() directly. + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__tunnel = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel(self): + self.__tunnel = YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + sharing = __builtin__.property(_get_sharing, _set_sharing) + tunnel = __builtin__.property(_get_tunnel, _set_tunnel) + + + _pyangbind_elements = OrderedDict([('sharing', sharing), ('tunnel', tunnel), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/tunnels/tunnel/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/tunnels/tunnel/__init__.py new file mode 100644 index 000000000..bfd6fae3f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/underlay/tunnels/tunnel/__init__.py @@ -0,0 +1,170 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class tunnel(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/underlay/tunnels/tunnel. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + __slots__ = ('_path_helper', '_extmethods', '__tunnel_name','__sharing',) + + _yang_name = 'tunnel' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tunnel_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + self.__sharing = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'underlay', 'tunnels', 'tunnel'] + + def _get_tunnel_name(self): + """ + Getter method for tunnel_name, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/tunnels/tunnel/tunnel_name (string) + + YANG Description: A tunnel name uniquely identifies an underlay TE tunnel, +used together with the 'source-node' value for this +link. + """ + return self.__tunnel_name + + def _set_tunnel_name(self, v, load=False): + """ + Setter method for tunnel_name, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/tunnels/tunnel/tunnel_name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel_name() directly. + + YANG Description: A tunnel name uniquely identifies an underlay TE tunnel, +used together with the 'source-node' value for this +link. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel_name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True)""", + }) + + self.__tunnel_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel_name(self): + self.__tunnel_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + + def _get_sharing(self): + """ + Getter method for sharing, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/tunnels/tunnel/sharing (boolean) + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. + """ + return self.__sharing + + def _set_sharing(self, v, load=False): + """ + Setter method for sharing, mapped from YANG variable /networks/network/link/te/te_link_attributes/underlay/tunnels/tunnel/sharing (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_sharing is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_sharing() directly. + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """sharing must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__sharing = t + if hasattr(self, '_set'): + self._set() + + def _unset_sharing(self): + self.__sharing = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + tunnel_name = __builtin__.property(_get_tunnel_name, _set_tunnel_name) + sharing = __builtin__.property(_get_sharing, _set_sharing) + + + _pyangbind_elements = OrderedDict([('tunnel_name', tunnel_name), ('sharing', sharing), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/unreserved_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/unreserved_bandwidth/__init__.py new file mode 100644 index 000000000..64b36f07a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/unreserved_bandwidth/__init__.py @@ -0,0 +1,163 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_bandwidth +class unreserved_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/unreserved-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unreserved bandwidth for priority levels 0-7. Units are in +bytes per second. + """ + __slots__ = ('_path_helper', '_extmethods', '__priority','__te_bandwidth',) + + _yang_name = 'unreserved-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'unreserved-bandwidth'] + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/link/te/te_link_attributes/unreserved_bandwidth/priority (uint8) + + YANG Description: Priority. + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/link/te/te_link_attributes/unreserved_bandwidth/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: Priority. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + + + def _get_te_bandwidth(self): + """ + Getter method for te_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth (container) + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + return self.__te_bandwidth + + def _set_te_bandwidth(self, v, load=False): + """ + Setter method for te_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_bandwidth() directly. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_bandwidth(self): + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + priority = __builtin__.property(_get_priority, _set_priority) + te_bandwidth = __builtin__.property(_get_te_bandwidth, _set_te_bandwidth) + + + _pyangbind_elements = OrderedDict([('priority', priority), ('te_bandwidth', te_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/__init__.py new file mode 100644 index 000000000..597c65903 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/__init__.py @@ -0,0 +1,195 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/unreserved-bandwidth/te-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_bandwidth',) + + _yang_name = 'te-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'unreserved-bandwidth', 'te-bandwidth'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/generic (te-bandwidth) + + YANG Description: Bandwidth specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/generic (te-bandwidth) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Bandwidth specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with te-bandwidth""", + 'defined-type': "ietf-te-topology:te-bandwidth", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn (container) + + YANG Description: Bandwidth attributes for OTN links + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Bandwidth attributes for OTN links + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_eth_bandwidth(self): + """ + Getter method for eth_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/eth_bandwidth (uint64) + + YANG Description: Available bandwith value expressed in kilobits per second + """ + return self.__eth_bandwidth + + def _set_eth_bandwidth(self, v, load=False): + """ + Setter method for eth_bandwidth, mapped from YANG variable /networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/eth_bandwidth (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_bandwidth() directly. + + YANG Description: Available bandwith value expressed in kilobits per second + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_bandwidth must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__eth_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_bandwidth(self): + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + eth_bandwidth = __builtin__.property(_get_eth_bandwidth, _set_eth_bandwidth) + + __choices__ = {'technology': {'generic': ['generic']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_bandwidth', eth_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/__init__.py new file mode 100644 index 000000000..602ca2e1a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import odulist +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/unreserved-bandwidth/te-bandwidth/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Bandwidth attributes for OTN links + """ + __slots__ = ('_path_helper', '_extmethods', '__odulist',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'unreserved-bandwidth', 'te-bandwidth', 'otn'] + + def _get_odulist(self): + """ + Getter method for odulist, mapped from YANG variable /networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist (list) + + YANG Description: OTN bandwidth definition + """ + return self.__odulist + + def _set_odulist(self, v, load=False): + """ + Setter method for odulist, mapped from YANG variable /networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_odulist is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odulist() directly. + + YANG Description: OTN bandwidth definition + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odulist must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True)""", + }) + + self.__odulist = t + if hasattr(self, '_set'): + self._set() + + def _unset_odulist(self): + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + + odulist = __builtin__.property(_get_odulist, _set_odulist) + + + _pyangbind_elements = OrderedDict([('odulist', odulist), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist/__init__.py new file mode 100644 index 000000000..94ca139a6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist/__init__.py @@ -0,0 +1,200 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class odulist(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/te-link-attributes/unreserved-bandwidth/te-bandwidth/otn/odulist. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: OTN bandwidth definition + """ + __slots__ = ('_path_helper', '_extmethods', '__odu_type','__number','__ts_number',) + + _yang_name = 'odulist' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'te-link-attributes', 'unreserved-bandwidth', 'te-bandwidth', 'otn', 'odulist'] + + def _get_odu_type(self): + """ + Getter method for odu_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist/odu_type (identityref) + + YANG Description: ODU type + """ + return self.__odu_type + + def _set_odu_type(self, v, load=False): + """ + Setter method for odu_type, mapped from YANG variable /networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist/odu_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type() directly. + + YANG Description: ODU type + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__odu_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type(self): + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_number(self): + """ + Getter method for number, mapped from YANG variable /networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist/number (uint16) + + YANG Description: Number of ODUs + """ + return self.__number + + def _set_number(self, v, load=False): + """ + Setter method for number, mapped from YANG variable /networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist/number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_number() directly. + + YANG Description: Number of ODUs + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__number = t + if hasattr(self, '_set'): + self._set() + + def _unset_number(self): + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + + def _get_ts_number(self): + """ + Getter method for ts_number, mapped from YANG variable /networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist/ts_number (uint16) + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + return self.__ts_number + + def _set_ts_number(self, v, load=False): + """ + Setter method for ts_number, mapped from YANG variable /networks/network/link/te/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist/ts_number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_number() directly. + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__ts_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_number(self): + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + odu_type = __builtin__.property(_get_odu_type, _set_odu_type) + number = __builtin__.property(_get_number, _set_number) + ts_number = __builtin__.property(_get_ts_number, _set_ts_number) + + + _pyangbind_elements = OrderedDict([('odu_type', odu_type), ('number', number), ('ts_number', ts_number), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/underlay/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/underlay/__init__.py new file mode 100644 index 000000000..f8ac511c0 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/link/te/underlay/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class underlay(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/link/te/underlay. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: State attributes for the TE link underlay. + """ + __slots__ = ('_path_helper', '_extmethods', '__dynamic','__committed',) + + _yang_name = 'underlay' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__dynamic = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="dynamic", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + self.__committed = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="committed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'link', 'te', 'underlay'] + + def _get_dynamic(self): + """ + Getter method for dynamic, mapped from YANG variable /networks/network/link/te/underlay/dynamic (boolean) + + YANG Description: 'true' if the underlay is dynamically created. + """ + return self.__dynamic + + def _set_dynamic(self, v, load=False): + """ + Setter method for dynamic, mapped from YANG variable /networks/network/link/te/underlay/dynamic (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_dynamic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_dynamic() directly. + + YANG Description: 'true' if the underlay is dynamically created. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="dynamic", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """dynamic must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="dynamic", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False)""", + }) + + self.__dynamic = t + if hasattr(self, '_set'): + self._set() + + def _unset_dynamic(self): + self.__dynamic = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="dynamic", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + + + def _get_committed(self): + """ + Getter method for committed, mapped from YANG variable /networks/network/link/te/underlay/committed (boolean) + + YANG Description: 'true' if the underlay is committed. + """ + return self.__committed + + def _set_committed(self, v, load=False): + """ + Setter method for committed, mapped from YANG variable /networks/network/link/te/underlay/committed (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_committed is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_committed() directly. + + YANG Description: 'true' if the underlay is committed. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="committed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """committed must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="committed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False)""", + }) + + self.__committed = t + if hasattr(self, '_set'): + self._set() + + def _unset_committed(self): + self.__committed = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="committed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + + dynamic = __builtin__.property(_get_dynamic) + committed = __builtin__.property(_get_committed) + + + _pyangbind_elements = OrderedDict([('dynamic', dynamic), ('committed', committed), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/network_types/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/network_types/__init__.py new file mode 100644 index 000000000..75d12adce --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/network_types/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_topology +class network_types(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/network-types. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Serves as an augmentation target. +The network type is indicated through corresponding +presence containers augmented into this container. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_topology',) + + _yang_name = 'network-types' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_topology = YANGDynClass(base=te_topology.te_topology, is_container='container', yang_name="te-topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'network-types'] + + def _get_te_topology(self): + """ + Getter method for te_topology, mapped from YANG variable /networks/network/network_types/te_topology (container) + + YANG Description: Its presence identifies the TE topology type. + """ + return self.__te_topology + + def _set_te_topology(self, v, load=False): + """ + Setter method for te_topology, mapped from YANG variable /networks/network/network_types/te_topology (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_topology is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_topology() directly. + + YANG Description: Its presence identifies the TE topology type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_topology.te_topology, is_container='container', yang_name="te-topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_topology must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_topology.te_topology, is_container='container', yang_name="te-topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_topology = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_topology(self): + self.__te_topology = YANGDynClass(base=te_topology.te_topology, is_container='container', yang_name="te-topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_topology = __builtin__.property(_get_te_topology, _set_te_topology) + + + _pyangbind_elements = OrderedDict([('te_topology', te_topology), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/network_types/te_topology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/network_types/te_topology/__init__.py new file mode 100644 index 000000000..0e986049c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/network_types/te_topology/__init__.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class te_topology(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/network-types/te-topology. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Its presence identifies the TE topology type. + """ + _pyangbind_elements = {} + + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/__init__.py new file mode 100644 index 000000000..11a249539 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/__init__.py @@ -0,0 +1,291 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import supporting_node +from . import termination_point +from . import te +class node(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The inventory of nodes of this network. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__supporting_node','__termination_point','__te_node_id','__te',) + + _yang_name = 'node' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="node-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='node-id', is_config=True) + self.__supporting_node = YANGDynClass(base=YANGListType("network_ref node_ref",supporting_node.supporting_node, yang_name="supporting-node", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='network-ref node-ref', extensions=None), is_container='list', yang_name="supporting-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='list', is_config=True) + self.__termination_point = YANGDynClass(base=YANGListType("tp_id",termination_point.termination_point, yang_name="termination-point", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tp-id', extensions=None), is_container='list', yang_name="termination-point", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='list', is_config=True) + self.__te_node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="te-node-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-node-id', is_config=True) + self.__te = YANGDynClass(base=te.te, is_container='container', yang_name="te", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/node_id (node-id) + + YANG Description: Uniquely identifies a node within the containing +network. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/node_id (node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: Uniquely identifies a node within the containing +network. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="node-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with node-id""", + 'defined-type': "ietf-network:node-id", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="node-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="node-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='node-id', is_config=True) + + + def _get_supporting_node(self): + """ + Getter method for supporting_node, mapped from YANG variable /networks/network/node/supporting_node (list) + + YANG Description: Represents another node that is in an underlay network +and that supports this node. Used to represent layering +structure. + """ + return self.__supporting_node + + def _set_supporting_node(self, v, load=False): + """ + Setter method for supporting_node, mapped from YANG variable /networks/network/node/supporting_node (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_supporting_node is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_supporting_node() directly. + + YANG Description: Represents another node that is in an underlay network +and that supports this node. Used to represent layering +structure. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("network_ref node_ref",supporting_node.supporting_node, yang_name="supporting-node", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='network-ref node-ref', extensions=None), is_container='list', yang_name="supporting-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """supporting_node must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("network_ref node_ref",supporting_node.supporting_node, yang_name="supporting-node", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='network-ref node-ref', extensions=None), is_container='list', yang_name="supporting-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='list', is_config=True)""", + }) + + self.__supporting_node = t + if hasattr(self, '_set'): + self._set() + + def _unset_supporting_node(self): + self.__supporting_node = YANGDynClass(base=YANGListType("network_ref node_ref",supporting_node.supporting_node, yang_name="supporting-node", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='network-ref node-ref', extensions=None), is_container='list', yang_name="supporting-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='list', is_config=True) + + + def _get_termination_point(self): + """ + Getter method for termination_point, mapped from YANG variable /networks/network/node/termination_point (list) + + YANG Description: A termination point can terminate a link. +Depending on the type of topology, a termination point +could, for example, refer to a port or an interface. + """ + return self.__termination_point + + def _set_termination_point(self, v, load=False): + """ + Setter method for termination_point, mapped from YANG variable /networks/network/node/termination_point (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_termination_point is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_termination_point() directly. + + YANG Description: A termination point can terminate a link. +Depending on the type of topology, a termination point +could, for example, refer to a port or an interface. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("tp_id",termination_point.termination_point, yang_name="termination-point", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tp-id', extensions=None), is_container='list', yang_name="termination-point", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """termination_point must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("tp_id",termination_point.termination_point, yang_name="termination-point", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tp-id', extensions=None), is_container='list', yang_name="termination-point", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='list', is_config=True)""", + }) + + self.__termination_point = t + if hasattr(self, '_set'): + self._set() + + def _unset_termination_point(self): + self.__termination_point = YANGDynClass(base=YANGListType("tp_id",termination_point.termination_point, yang_name="termination-point", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tp-id', extensions=None), is_container='list', yang_name="termination-point", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='list', is_config=True) + + + def _get_te_node_id(self): + """ + Getter method for te_node_id, mapped from YANG variable /networks/network/node/te_node_id (te-types:te-node-id) + + YANG Description: The identifier of a node in the TE topology. +A node is specific to a topology to which it belongs. + """ + return self.__te_node_id + + def _set_te_node_id(self, v, load=False): + """ + Setter method for te_node_id, mapped from YANG variable /networks/network/node/te_node_id (te-types:te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. +A node is specific to a topology to which it belongs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="te-node-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_node_id must be of a type compatible with te-types:te-node-id""", + 'defined-type': "te-types:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="te-node-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-node-id', is_config=True)""", + }) + + self.__te_node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_node_id(self): + self.__te_node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="te-node-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-node-id', is_config=True) + + + def _get_te(self): + """ + Getter method for te, mapped from YANG variable /networks/network/node/te (container) + + YANG Description: Indicates TE support. + """ + return self.__te + + def _set_te(self, v, load=False): + """ + Setter method for te, mapped from YANG variable /networks/network/node/te (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te() directly. + + YANG Description: Indicates TE support. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te.te, is_container='container', yang_name="te", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te.te, is_container='container', yang_name="te", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te = t + if hasattr(self, '_set'): + self._set() + + def _unset_te(self): + self.__te = YANGDynClass(base=te.te, is_container='container', yang_name="te", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + supporting_node = __builtin__.property(_get_supporting_node, _set_supporting_node) + termination_point = __builtin__.property(_get_termination_point, _set_termination_point) + te_node_id = __builtin__.property(_get_te_node_id, _set_te_node_id) + te = __builtin__.property(_get_te, _set_te) + + + _pyangbind_elements = OrderedDict([('node_id', node_id), ('supporting_node', supporting_node), ('termination_point', termination_point), ('te_node_id', te_node_id), ('te', te), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/supporting_node/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/supporting_node/__init__.py new file mode 100644 index 000000000..c4cd2fc8e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/supporting_node/__init__.py @@ -0,0 +1,168 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class supporting_node(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/supporting-node. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Represents another node that is in an underlay network +and that supports this node. Used to represent layering +structure. + """ + __slots__ = ('_path_helper', '_extmethods', '__network_ref','__node_ref',) + + _yang_name = 'supporting-node' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='leafref', is_config=True) + self.__node_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="node-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='leafref', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'supporting-node'] + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/node/supporting_node/network_ref (leafref) + + YANG Description: References the underlay network of which the +underlay node is a part. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/node/supporting_node/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: References the underlay network of which the +underlay node is a part. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='leafref', is_config=True)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='leafref', is_config=True) + + + def _get_node_ref(self): + """ + Getter method for node_ref, mapped from YANG variable /networks/network/node/supporting_node/node_ref (leafref) + + YANG Description: References the underlay node itself. + """ + return self.__node_ref + + def _set_node_ref(self, v, load=False): + """ + Setter method for node_ref, mapped from YANG variable /networks/network/node/supporting_node/node_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_ref() directly. + + YANG Description: References the underlay node itself. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="node-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="node-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='leafref', is_config=True)""", + }) + + self.__node_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_ref(self): + self.__node_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="node-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='leafref', is_config=True) + + network_ref = __builtin__.property(_get_network_ref, _set_network_ref) + node_ref = __builtin__.property(_get_node_ref, _set_node_ref) + + + _pyangbind_elements = OrderedDict([('network_ref', network_ref), ('node_ref', node_ref), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/__init__.py new file mode 100644 index 000000000..90adef961 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/__init__.py @@ -0,0 +1,519 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_node_attributes +from . import geolocation +from . import information_source_state +from . import information_source_entry +from . import statistics +from . import tunnel_termination_point +class te(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Indicates TE support. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_node_template','__te_node_attributes','__oper_status','__geolocation','__is_multi_access_dr','__information_source','__information_source_instance','__information_source_state','__information_source_entry','__statistics','__tunnel_termination_point',) + + _yang_name = 'te' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_node_template = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="te-node-template", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + self.__te_node_attributes = YANGDynClass(base=te_node_attributes.te_node_attributes, is_container='container', yang_name="te-node-attributes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__oper_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-oper-status', is_config=False) + self.__geolocation = YANGDynClass(base=geolocation.geolocation, is_container='container', yang_name="geolocation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__is_multi_access_dr = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-multi-access-dr", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=False) + self.__information_source = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'unknown': {}, 'locally-configured': {}, 'ospfv2': {}, 'ospfv3': {}, 'isis': {}, 'bgp-ls': {}, 'system-processed': {}, 'other': {}},), is_leaf=True, yang_name="information-source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-info-source', is_config=False) + self.__information_source_instance = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="information-source-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + self.__information_source_state = YANGDynClass(base=information_source_state.information_source_state, is_container='container', yang_name="information-source-state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__information_source_entry = YANGDynClass(base=YANGListType("information_source information_source_instance",information_source_entry.information_source_entry, yang_name="information-source-entry", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='information-source information-source-instance', extensions=None), is_container='list', yang_name="information-source-entry", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + self.__statistics = YANGDynClass(base=statistics.statistics, is_container='container', yang_name="statistics", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__tunnel_termination_point = YANGDynClass(base=YANGListType("tunnel_tp_id",tunnel_termination_point.tunnel_termination_point, yang_name="tunnel-termination-point", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-tp-id', extensions=None), is_container='list', yang_name="tunnel-termination-point", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te'] + + def _get_te_node_template(self): + """ + Getter method for te_node_template, mapped from YANG variable /networks/network/node/te/te_node_template (leafref) + + YANG Description: The reference to a TE node template. + """ + return self.__te_node_template + + def _set_te_node_template(self, v, load=False): + """ + Setter method for te_node_template, mapped from YANG variable /networks/network/node/te/te_node_template (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_node_template is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_node_template() directly. + + YANG Description: The reference to a TE node template. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="te-node-template", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_node_template must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="te-node-template", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__te_node_template = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_node_template(self): + self.__te_node_template = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="te-node-template", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + + def _get_te_node_attributes(self): + """ + Getter method for te_node_attributes, mapped from YANG variable /networks/network/node/te/te_node_attributes (container) + + YANG Description: Contains node attributes in a TE topology. + """ + return self.__te_node_attributes + + def _set_te_node_attributes(self, v, load=False): + """ + Setter method for te_node_attributes, mapped from YANG variable /networks/network/node/te/te_node_attributes (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_node_attributes is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_node_attributes() directly. + + YANG Description: Contains node attributes in a TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_node_attributes.te_node_attributes, is_container='container', yang_name="te-node-attributes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_node_attributes must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_node_attributes.te_node_attributes, is_container='container', yang_name="te-node-attributes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_node_attributes = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_node_attributes(self): + self.__te_node_attributes = YANGDynClass(base=te_node_attributes.te_node_attributes, is_container='container', yang_name="te-node-attributes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_oper_status(self): + """ + Getter method for oper_status, mapped from YANG variable /networks/network/node/te/oper_status (te-types:te-oper-status) + + YANG Description: The current operational state of the node. + """ + return self.__oper_status + + def _set_oper_status(self, v, load=False): + """ + Setter method for oper_status, mapped from YANG variable /networks/network/node/te/oper_status (te-types:te-oper-status) + If this variable is read-only (config: false) in the + source YANG file, then _set_oper_status is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_oper_status() directly. + + YANG Description: The current operational state of the node. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-oper-status', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """oper_status must be of a type compatible with te-types:te-oper-status""", + 'defined-type': "te-types:te-oper-status", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-oper-status', is_config=False)""", + }) + + self.__oper_status = t + if hasattr(self, '_set'): + self._set() + + def _unset_oper_status(self): + self.__oper_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-oper-status', is_config=False) + + + def _get_geolocation(self): + """ + Getter method for geolocation, mapped from YANG variable /networks/network/node/te/geolocation (container) + + YANG Description: Contains a GPS location. + """ + return self.__geolocation + + def _set_geolocation(self, v, load=False): + """ + Setter method for geolocation, mapped from YANG variable /networks/network/node/te/geolocation (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_geolocation is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_geolocation() directly. + + YANG Description: Contains a GPS location. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=geolocation.geolocation, is_container='container', yang_name="geolocation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """geolocation must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=geolocation.geolocation, is_container='container', yang_name="geolocation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__geolocation = t + if hasattr(self, '_set'): + self._set() + + def _unset_geolocation(self): + self.__geolocation = YANGDynClass(base=geolocation.geolocation, is_container='container', yang_name="geolocation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_is_multi_access_dr(self): + """ + Getter method for is_multi_access_dr, mapped from YANG variable /networks/network/node/te/is_multi_access_dr (empty) + + YANG Description: The presence of this attribute indicates that this TE node +is a pseudonode elected as a designated router. + """ + return self.__is_multi_access_dr + + def _set_is_multi_access_dr(self, v, load=False): + """ + Setter method for is_multi_access_dr, mapped from YANG variable /networks/network/node/te/is_multi_access_dr (empty) + If this variable is read-only (config: false) in the + source YANG file, then _set_is_multi_access_dr is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_is_multi_access_dr() directly. + + YANG Description: The presence of this attribute indicates that this TE node +is a pseudonode elected as a designated router. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="is-multi-access-dr", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """is_multi_access_dr must be of a type compatible with empty""", + 'defined-type': "empty", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-multi-access-dr", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=False)""", + }) + + self.__is_multi_access_dr = t + if hasattr(self, '_set'): + self._set() + + def _unset_is_multi_access_dr(self): + self.__is_multi_access_dr = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-multi-access-dr", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=False) + + + def _get_information_source(self): + """ + Getter method for information_source, mapped from YANG variable /networks/network/node/te/information_source (te-info-source) + + YANG Description: Indicates the type of information source. + """ + return self.__information_source + + def _set_information_source(self, v, load=False): + """ + Setter method for information_source, mapped from YANG variable /networks/network/node/te/information_source (te-info-source) + If this variable is read-only (config: false) in the + source YANG file, then _set_information_source is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_information_source() directly. + + YANG Description: Indicates the type of information source. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'unknown': {}, 'locally-configured': {}, 'ospfv2': {}, 'ospfv3': {}, 'isis': {}, 'bgp-ls': {}, 'system-processed': {}, 'other': {}},), is_leaf=True, yang_name="information-source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-info-source', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """information_source must be of a type compatible with te-info-source""", + 'defined-type': "ietf-te-topology:te-info-source", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'unknown': {}, 'locally-configured': {}, 'ospfv2': {}, 'ospfv3': {}, 'isis': {}, 'bgp-ls': {}, 'system-processed': {}, 'other': {}},), is_leaf=True, yang_name="information-source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-info-source', is_config=False)""", + }) + + self.__information_source = t + if hasattr(self, '_set'): + self._set() + + def _unset_information_source(self): + self.__information_source = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'unknown': {}, 'locally-configured': {}, 'ospfv2': {}, 'ospfv3': {}, 'isis': {}, 'bgp-ls': {}, 'system-processed': {}, 'other': {}},), is_leaf=True, yang_name="information-source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-info-source', is_config=False) + + + def _get_information_source_instance(self): + """ + Getter method for information_source_instance, mapped from YANG variable /networks/network/node/te/information_source_instance (string) + + YANG Description: The name indicating the instance of the information +source. + """ + return self.__information_source_instance + + def _set_information_source_instance(self, v, load=False): + """ + Setter method for information_source_instance, mapped from YANG variable /networks/network/node/te/information_source_instance (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_information_source_instance is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_information_source_instance() directly. + + YANG Description: The name indicating the instance of the information +source. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="information-source-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """information_source_instance must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="information-source-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__information_source_instance = t + if hasattr(self, '_set'): + self._set() + + def _unset_information_source_instance(self): + self.__information_source_instance = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="information-source-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + + def _get_information_source_state(self): + """ + Getter method for information_source_state, mapped from YANG variable /networks/network/node/te/information_source_state (container) + + YANG Description: Contains state attributes related to the information +source. + """ + return self.__information_source_state + + def _set_information_source_state(self, v, load=False): + """ + Setter method for information_source_state, mapped from YANG variable /networks/network/node/te/information_source_state (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_information_source_state is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_information_source_state() directly. + + YANG Description: Contains state attributes related to the information +source. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=information_source_state.information_source_state, is_container='container', yang_name="information-source-state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """information_source_state must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=information_source_state.information_source_state, is_container='container', yang_name="information-source-state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__information_source_state = t + if hasattr(self, '_set'): + self._set() + + def _unset_information_source_state(self): + self.__information_source_state = YANGDynClass(base=information_source_state.information_source_state, is_container='container', yang_name="information-source-state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_information_source_entry(self): + """ + Getter method for information_source_entry, mapped from YANG variable /networks/network/node/te/information_source_entry (list) + + YANG Description: A list of information sources learned, including the source +that is used. + """ + return self.__information_source_entry + + def _set_information_source_entry(self, v, load=False): + """ + Setter method for information_source_entry, mapped from YANG variable /networks/network/node/te/information_source_entry (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_information_source_entry is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_information_source_entry() directly. + + YANG Description: A list of information sources learned, including the source +that is used. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("information_source information_source_instance",information_source_entry.information_source_entry, yang_name="information-source-entry", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='information-source information-source-instance', extensions=None), is_container='list', yang_name="information-source-entry", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """information_source_entry must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("information_source information_source_instance",information_source_entry.information_source_entry, yang_name="information-source-entry", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='information-source information-source-instance', extensions=None), is_container='list', yang_name="information-source-entry", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__information_source_entry = t + if hasattr(self, '_set'): + self._set() + + def _unset_information_source_entry(self): + self.__information_source_entry = YANGDynClass(base=YANGListType("information_source information_source_instance",information_source_entry.information_source_entry, yang_name="information-source-entry", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='information-source information-source-instance', extensions=None), is_container='list', yang_name="information-source-entry", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + + def _get_statistics(self): + """ + Getter method for statistics, mapped from YANG variable /networks/network/node/te/statistics (container) + + YANG Description: Statistics data. + """ + return self.__statistics + + def _set_statistics(self, v, load=False): + """ + Setter method for statistics, mapped from YANG variable /networks/network/node/te/statistics (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_statistics is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_statistics() directly. + + YANG Description: Statistics data. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=statistics.statistics, is_container='container', yang_name="statistics", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """statistics must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=statistics.statistics, is_container='container', yang_name="statistics", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__statistics = t + if hasattr(self, '_set'): + self._set() + + def _unset_statistics(self): + self.__statistics = YANGDynClass(base=statistics.statistics, is_container='container', yang_name="statistics", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_tunnel_termination_point(self): + """ + Getter method for tunnel_termination_point, mapped from YANG variable /networks/network/node/te/tunnel_termination_point (list) + + YANG Description: A termination point can terminate a tunnel. + """ + return self.__tunnel_termination_point + + def _set_tunnel_termination_point(self, v, load=False): + """ + Setter method for tunnel_termination_point, mapped from YANG variable /networks/network/node/te/tunnel_termination_point (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel_termination_point is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel_termination_point() directly. + + YANG Description: A termination point can terminate a tunnel. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("tunnel_tp_id",tunnel_termination_point.tunnel_termination_point, yang_name="tunnel-termination-point", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-tp-id', extensions=None), is_container='list', yang_name="tunnel-termination-point", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel_termination_point must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("tunnel_tp_id",tunnel_termination_point.tunnel_termination_point, yang_name="tunnel-termination-point", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-tp-id', extensions=None), is_container='list', yang_name="tunnel-termination-point", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__tunnel_termination_point = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel_termination_point(self): + self.__tunnel_termination_point = YANGDynClass(base=YANGListType("tunnel_tp_id",tunnel_termination_point.tunnel_termination_point, yang_name="tunnel-termination-point", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-tp-id', extensions=None), is_container='list', yang_name="tunnel-termination-point", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + te_node_template = __builtin__.property(_get_te_node_template, _set_te_node_template) + te_node_attributes = __builtin__.property(_get_te_node_attributes, _set_te_node_attributes) + oper_status = __builtin__.property(_get_oper_status) + geolocation = __builtin__.property(_get_geolocation) + is_multi_access_dr = __builtin__.property(_get_is_multi_access_dr) + information_source = __builtin__.property(_get_information_source) + information_source_instance = __builtin__.property(_get_information_source_instance) + information_source_state = __builtin__.property(_get_information_source_state) + information_source_entry = __builtin__.property(_get_information_source_entry) + statistics = __builtin__.property(_get_statistics) + tunnel_termination_point = __builtin__.property(_get_tunnel_termination_point, _set_tunnel_termination_point) + + + _pyangbind_elements = OrderedDict([('te_node_template', te_node_template), ('te_node_attributes', te_node_attributes), ('oper_status', oper_status), ('geolocation', geolocation), ('is_multi_access_dr', is_multi_access_dr), ('information_source', information_source), ('information_source_instance', information_source_instance), ('information_source_state', information_source_state), ('information_source_entry', information_source_entry), ('statistics', statistics), ('tunnel_termination_point', tunnel_termination_point), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/geolocation/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/geolocation/__init__.py new file mode 100644 index 000000000..f9e405188 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/geolocation/__init__.py @@ -0,0 +1,193 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class geolocation(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/geolocation. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains a GPS location. + """ + __slots__ = ('_path_helper', '_extmethods', '__altitude','__latitude','__longitude',) + + _yang_name = 'geolocation' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__altitude = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64), is_leaf=True, yang_name="altitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int64', is_config=False) + self.__latitude = YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-90..90']}), is_leaf=True, yang_name="latitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False) + self.__longitude = YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-180..180']}), is_leaf=True, yang_name="longitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'geolocation'] + + def _get_altitude(self): + """ + Getter method for altitude, mapped from YANG variable /networks/network/node/te/geolocation/altitude (int64) + + YANG Description: Distance above sea level. + """ + return self.__altitude + + def _set_altitude(self, v, load=False): + """ + Setter method for altitude, mapped from YANG variable /networks/network/node/te/geolocation/altitude (int64) + If this variable is read-only (config: false) in the + source YANG file, then _set_altitude is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_altitude() directly. + + YANG Description: Distance above sea level. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64), is_leaf=True, yang_name="altitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """altitude must be of a type compatible with int64""", + 'defined-type': "int64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64), is_leaf=True, yang_name="altitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int64', is_config=False)""", + }) + + self.__altitude = t + if hasattr(self, '_set'): + self._set() + + def _unset_altitude(self): + self.__altitude = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64), is_leaf=True, yang_name="altitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int64', is_config=False) + + + def _get_latitude(self): + """ + Getter method for latitude, mapped from YANG variable /networks/network/node/te/geolocation/latitude (geographic-coordinate-degree) + + YANG Description: Relative position north or south on the Earth's surface. + """ + return self.__latitude + + def _set_latitude(self, v, load=False): + """ + Setter method for latitude, mapped from YANG variable /networks/network/node/te/geolocation/latitude (geographic-coordinate-degree) + If this variable is read-only (config: false) in the + source YANG file, then _set_latitude is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_latitude() directly. + + YANG Description: Relative position north or south on the Earth's surface. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-90..90']}), is_leaf=True, yang_name="latitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """latitude must be of a type compatible with geographic-coordinate-degree""", + 'defined-type': "ietf-te-topology:geographic-coordinate-degree", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-90..90']}), is_leaf=True, yang_name="latitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False)""", + }) + + self.__latitude = t + if hasattr(self, '_set'): + self._set() + + def _unset_latitude(self): + self.__latitude = YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-90..90']}), is_leaf=True, yang_name="latitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False) + + + def _get_longitude(self): + """ + Getter method for longitude, mapped from YANG variable /networks/network/node/te/geolocation/longitude (geographic-coordinate-degree) + + YANG Description: Angular distance east or west on the Earth's surface. + """ + return self.__longitude + + def _set_longitude(self, v, load=False): + """ + Setter method for longitude, mapped from YANG variable /networks/network/node/te/geolocation/longitude (geographic-coordinate-degree) + If this variable is read-only (config: false) in the + source YANG file, then _set_longitude is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_longitude() directly. + + YANG Description: Angular distance east or west on the Earth's surface. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-180..180']}), is_leaf=True, yang_name="longitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """longitude must be of a type compatible with geographic-coordinate-degree""", + 'defined-type': "ietf-te-topology:geographic-coordinate-degree", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-180..180']}), is_leaf=True, yang_name="longitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False)""", + }) + + self.__longitude = t + if hasattr(self, '_set'): + self._set() + + def _unset_longitude(self): + self.__longitude = YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-180..180']}), is_leaf=True, yang_name="longitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False) + + altitude = __builtin__.property(_get_altitude) + latitude = __builtin__.property(_get_latitude) + longitude = __builtin__.property(_get_longitude) + + + _pyangbind_elements = OrderedDict([('altitude', altitude), ('latitude', latitude), ('longitude', longitude), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/__init__.py new file mode 100644 index 000000000..5e51769ff --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/__init__.py @@ -0,0 +1,451 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import information_source_state +from . import connectivity_matrices +from . import underlay_topology +class information_source_entry(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of information sources learned, including the source +that is used. + """ + __slots__ = ('_path_helper', '_extmethods', '__information_source','__information_source_instance','__information_source_state','__connectivity_matrices','__domain_id','__is_abstract','__name','__signaling_address','__underlay_topology',) + + _yang_name = 'information-source-entry' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__information_source = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'unknown': {}, 'locally-configured': {}, 'ospfv2': {}, 'ospfv3': {}, 'isis': {}, 'bgp-ls': {}, 'system-processed': {}, 'other': {}},), is_leaf=True, yang_name="information-source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-info-source', is_config=False) + self.__information_source_instance = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="information-source-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + self.__information_source_state = YANGDynClass(base=information_source_state.information_source_state, is_container='container', yang_name="information-source-state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__connectivity_matrices = YANGDynClass(base=connectivity_matrices.connectivity_matrices, is_container='container', yang_name="connectivity-matrices", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__domain_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="domain-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__is_abstract = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-abstract", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=False) + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + self.__signaling_address = YANGDynClass(unique=True, base=TypedListType(allowed_type=[RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),]), is_leaf=False, yang_name="signaling-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:ip-address', is_config=False) + self.__underlay_topology = YANGDynClass(base=underlay_topology.underlay_topology, is_container='container', yang_name="underlay-topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry'] + + def _get_information_source(self): + """ + Getter method for information_source, mapped from YANG variable /networks/network/node/te/information_source_entry/information_source (te-info-source) + + YANG Description: Indicates the type of information source. + """ + return self.__information_source + + def _set_information_source(self, v, load=False): + """ + Setter method for information_source, mapped from YANG variable /networks/network/node/te/information_source_entry/information_source (te-info-source) + If this variable is read-only (config: false) in the + source YANG file, then _set_information_source is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_information_source() directly. + + YANG Description: Indicates the type of information source. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'unknown': {}, 'locally-configured': {}, 'ospfv2': {}, 'ospfv3': {}, 'isis': {}, 'bgp-ls': {}, 'system-processed': {}, 'other': {}},), is_leaf=True, yang_name="information-source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-info-source', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """information_source must be of a type compatible with te-info-source""", + 'defined-type': "ietf-te-topology:te-info-source", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'unknown': {}, 'locally-configured': {}, 'ospfv2': {}, 'ospfv3': {}, 'isis': {}, 'bgp-ls': {}, 'system-processed': {}, 'other': {}},), is_leaf=True, yang_name="information-source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-info-source', is_config=False)""", + }) + + self.__information_source = t + if hasattr(self, '_set'): + self._set() + + def _unset_information_source(self): + self.__information_source = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'unknown': {}, 'locally-configured': {}, 'ospfv2': {}, 'ospfv3': {}, 'isis': {}, 'bgp-ls': {}, 'system-processed': {}, 'other': {}},), is_leaf=True, yang_name="information-source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-info-source', is_config=False) + + + def _get_information_source_instance(self): + """ + Getter method for information_source_instance, mapped from YANG variable /networks/network/node/te/information_source_entry/information_source_instance (string) + + YANG Description: The name indicating the instance of the information +source. + """ + return self.__information_source_instance + + def _set_information_source_instance(self, v, load=False): + """ + Setter method for information_source_instance, mapped from YANG variable /networks/network/node/te/information_source_entry/information_source_instance (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_information_source_instance is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_information_source_instance() directly. + + YANG Description: The name indicating the instance of the information +source. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="information-source-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """information_source_instance must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="information-source-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__information_source_instance = t + if hasattr(self, '_set'): + self._set() + + def _unset_information_source_instance(self): + self.__information_source_instance = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="information-source-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + + def _get_information_source_state(self): + """ + Getter method for information_source_state, mapped from YANG variable /networks/network/node/te/information_source_entry/information_source_state (container) + + YANG Description: Contains state attributes related to the information +source. + """ + return self.__information_source_state + + def _set_information_source_state(self, v, load=False): + """ + Setter method for information_source_state, mapped from YANG variable /networks/network/node/te/information_source_entry/information_source_state (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_information_source_state is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_information_source_state() directly. + + YANG Description: Contains state attributes related to the information +source. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=information_source_state.information_source_state, is_container='container', yang_name="information-source-state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """information_source_state must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=information_source_state.information_source_state, is_container='container', yang_name="information-source-state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__information_source_state = t + if hasattr(self, '_set'): + self._set() + + def _unset_information_source_state(self): + self.__information_source_state = YANGDynClass(base=information_source_state.information_source_state, is_container='container', yang_name="information-source-state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_connectivity_matrices(self): + """ + Getter method for connectivity_matrices, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices (container) + + YANG Description: Contains a connectivity matrix on a TE node. + """ + return self.__connectivity_matrices + + def _set_connectivity_matrices(self, v, load=False): + """ + Setter method for connectivity_matrices, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_connectivity_matrices is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_connectivity_matrices() directly. + + YANG Description: Contains a connectivity matrix on a TE node. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=connectivity_matrices.connectivity_matrices, is_container='container', yang_name="connectivity-matrices", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """connectivity_matrices must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=connectivity_matrices.connectivity_matrices, is_container='container', yang_name="connectivity-matrices", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__connectivity_matrices = t + if hasattr(self, '_set'): + self._set() + + def _unset_connectivity_matrices(self): + self.__connectivity_matrices = YANGDynClass(base=connectivity_matrices.connectivity_matrices, is_container='container', yang_name="connectivity-matrices", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_domain_id(self): + """ + Getter method for domain_id, mapped from YANG variable /networks/network/node/te/information_source_entry/domain_id (uint32) + + YANG Description: Identifies the domain to which this node belongs. +This attribute is used to support inter-domain links. + """ + return self.__domain_id + + def _set_domain_id(self, v, load=False): + """ + Setter method for domain_id, mapped from YANG variable /networks/network/node/te/information_source_entry/domain_id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_domain_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_domain_id() directly. + + YANG Description: Identifies the domain to which this node belongs. +This attribute is used to support inter-domain links. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="domain-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """domain_id must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="domain-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False)""", + }) + + self.__domain_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_domain_id(self): + self.__domain_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="domain-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_is_abstract(self): + """ + Getter method for is_abstract, mapped from YANG variable /networks/network/node/te/information_source_entry/is_abstract (empty) + + YANG Description: Present if the node is abstract; not present if the node +is actual. + """ + return self.__is_abstract + + def _set_is_abstract(self, v, load=False): + """ + Setter method for is_abstract, mapped from YANG variable /networks/network/node/te/information_source_entry/is_abstract (empty) + If this variable is read-only (config: false) in the + source YANG file, then _set_is_abstract is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_is_abstract() directly. + + YANG Description: Present if the node is abstract; not present if the node +is actual. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="is-abstract", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """is_abstract must be of a type compatible with empty""", + 'defined-type': "empty", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-abstract", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=False)""", + }) + + self.__is_abstract = t + if hasattr(self, '_set'): + self._set() + + def _unset_is_abstract(self): + self.__is_abstract = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-abstract", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=False) + + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /networks/network/node/te/information_source_entry/name (string) + + YANG Description: Node name. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /networks/network/node/te/information_source_entry/name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: Node name. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + + def _get_signaling_address(self): + """ + Getter method for signaling_address, mapped from YANG variable /networks/network/node/te/information_source_entry/signaling_address (inet:ip-address) + + YANG Description: The node's signaling address. + """ + return self.__signaling_address + + def _set_signaling_address(self, v, load=False): + """ + Setter method for signaling_address, mapped from YANG variable /networks/network/node/te/information_source_entry/signaling_address (inet:ip-address) + If this variable is read-only (config: false) in the + source YANG file, then _set_signaling_address is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_signaling_address() directly. + + YANG Description: The node's signaling address. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=[RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),]), is_leaf=False, yang_name="signaling-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:ip-address', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """signaling_address must be of a type compatible with inet:ip-address""", + 'defined-type': "inet:ip-address", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=[RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),]), is_leaf=False, yang_name="signaling-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:ip-address', is_config=False)""", + }) + + self.__signaling_address = t + if hasattr(self, '_set'): + self._set() + + def _unset_signaling_address(self): + self.__signaling_address = YANGDynClass(unique=True, base=TypedListType(allowed_type=[RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),]), is_leaf=False, yang_name="signaling-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:ip-address', is_config=False) + + + def _get_underlay_topology(self): + """ + Getter method for underlay_topology, mapped from YANG variable /networks/network/node/te/information_source_entry/underlay_topology (container) + + YANG Description: When an abstract node encapsulates a topology, the +attributes in this container point to said topology. + """ + return self.__underlay_topology + + def _set_underlay_topology(self, v, load=False): + """ + Setter method for underlay_topology, mapped from YANG variable /networks/network/node/te/information_source_entry/underlay_topology (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_underlay_topology is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_underlay_topology() directly. + + YANG Description: When an abstract node encapsulates a topology, the +attributes in this container point to said topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=underlay_topology.underlay_topology, is_container='container', yang_name="underlay-topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """underlay_topology must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=underlay_topology.underlay_topology, is_container='container', yang_name="underlay-topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__underlay_topology = t + if hasattr(self, '_set'): + self._set() + + def _unset_underlay_topology(self): + self.__underlay_topology = YANGDynClass(base=underlay_topology.underlay_topology, is_container='container', yang_name="underlay-topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + information_source = __builtin__.property(_get_information_source) + information_source_instance = __builtin__.property(_get_information_source_instance) + information_source_state = __builtin__.property(_get_information_source_state) + connectivity_matrices = __builtin__.property(_get_connectivity_matrices) + domain_id = __builtin__.property(_get_domain_id) + is_abstract = __builtin__.property(_get_is_abstract) + name = __builtin__.property(_get_name) + signaling_address = __builtin__.property(_get_signaling_address) + underlay_topology = __builtin__.property(_get_underlay_topology) + + + _pyangbind_elements = OrderedDict([('information_source', information_source), ('information_source_instance', information_source_instance), ('information_source_state', information_source_state), ('connectivity_matrices', connectivity_matrices), ('domain_id', domain_id), ('is_abstract', is_abstract), ('name', name), ('signaling_address', signaling_address), ('underlay_topology', underlay_topology), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/__init__.py new file mode 100644 index 000000000..a773758ba --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/__init__.py @@ -0,0 +1,412 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import label_restrictions +from . import underlay +from . import path_constraints +from . import optimizations +from . import path_properties +from . import connectivity_matrix +class connectivity_matrices(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains a connectivity matrix on a TE node. + """ + __slots__ = ('_path_helper', '_extmethods', '__number_of_entries','__label_restrictions','__is_allowed','__underlay','__path_constraints','__optimizations','__path_properties','__connectivity_matrix',) + + _yang_name = 'connectivity-matrices' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__number_of_entries = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number-of-entries", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=False) + self.__label_restrictions = YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__is_allowed = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + self.__underlay = YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_constraints = YANGDynClass(base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__optimizations = YANGDynClass(base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_properties = YANGDynClass(base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__connectivity_matrix = YANGDynClass(base=YANGListType("id",connectivity_matrix.connectivity_matrix, yang_name="connectivity-matrix", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='id', extensions=None), is_container='list', yang_name="connectivity-matrix", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices'] + + def _get_number_of_entries(self): + """ + Getter method for number_of_entries, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/number_of_entries (uint16) + + YANG Description: The number of connectivity matrix entries. +If this number is specified in the configuration request, +the number is the requested number of entries, which may +not all be listed in the list; +if this number is reported in the state data, +the number is the current number of operational entries. + """ + return self.__number_of_entries + + def _set_number_of_entries(self, v, load=False): + """ + Setter method for number_of_entries, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/number_of_entries (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_number_of_entries is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_number_of_entries() directly. + + YANG Description: The number of connectivity matrix entries. +If this number is specified in the configuration request, +the number is the requested number of entries, which may +not all be listed in the list; +if this number is reported in the state data, +the number is the current number of operational entries. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number-of-entries", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """number_of_entries must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number-of-entries", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=False)""", + }) + + self.__number_of_entries = t + if hasattr(self, '_set'): + self._set() + + def _unset_number_of_entries(self): + self.__number_of_entries = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number-of-entries", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=False) + + + def _get_label_restrictions(self): + """ + Getter method for label_restrictions, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions (container) + + YANG Description: The label restrictions container. + """ + return self.__label_restrictions + + def _set_label_restrictions(self, v, load=False): + """ + Setter method for label_restrictions, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_restrictions is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_restrictions() directly. + + YANG Description: The label restrictions container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_restrictions must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_restrictions = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_restrictions(self): + self.__label_restrictions = YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_is_allowed(self): + """ + Getter method for is_allowed, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/is_allowed (boolean) + + YANG Description: 'true' - switching is allowed; +'false' - switching is disallowed. + """ + return self.__is_allowed + + def _set_is_allowed(self, v, load=False): + """ + Setter method for is_allowed, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/is_allowed (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_is_allowed is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_is_allowed() directly. + + YANG Description: 'true' - switching is allowed; +'false' - switching is disallowed. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """is_allowed must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False)""", + }) + + self.__is_allowed = t + if hasattr(self, '_set'): + self._set() + + def _unset_is_allowed(self): + self.__is_allowed = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + + + def _get_underlay(self): + """ + Getter method for underlay, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay (container) + + YANG Description: Attributes of the TE link underlay. + """ + return self.__underlay + + def _set_underlay(self, v, load=False): + """ + Setter method for underlay, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_underlay is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_underlay() directly. + + YANG Description: Attributes of the TE link underlay. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """underlay must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__underlay = t + if hasattr(self, '_set'): + self._set() + + def _unset_underlay(self): + self.__underlay = YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_constraints(self): + """ + Getter method for path_constraints, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints (container) + + YANG Description: TE named path constraints container. + """ + return self.__path_constraints + + def _set_path_constraints(self, v, load=False): + """ + Setter method for path_constraints, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_constraints is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_constraints() directly. + + YANG Description: TE named path constraints container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_constraints must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_constraints = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_constraints(self): + self.__path_constraints = YANGDynClass(base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_optimizations(self): + """ + Getter method for optimizations, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations (container) + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + return self.__optimizations + + def _set_optimizations(self, v, load=False): + """ + Setter method for optimizations, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_optimizations is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_optimizations() directly. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """optimizations must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__optimizations = t + if hasattr(self, '_set'): + self._set() + + def _unset_optimizations(self): + self.__optimizations = YANGDynClass(base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_properties(self): + """ + Getter method for path_properties, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties (container) + + YANG Description: The TE path properties. + """ + return self.__path_properties + + def _set_path_properties(self, v, load=False): + """ + Setter method for path_properties, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_properties is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_properties() directly. + + YANG Description: The TE path properties. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_properties must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_properties = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_properties(self): + self.__path_properties = YANGDynClass(base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_connectivity_matrix(self): + """ + Getter method for connectivity_matrix, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix (list) + + YANG Description: Represents a node's switching limitations, i.e., +limitations in the interconnecting network TE links +across the node. + """ + return self.__connectivity_matrix + + def _set_connectivity_matrix(self, v, load=False): + """ + Setter method for connectivity_matrix, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_connectivity_matrix is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_connectivity_matrix() directly. + + YANG Description: Represents a node's switching limitations, i.e., +limitations in the interconnecting network TE links +across the node. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("id",connectivity_matrix.connectivity_matrix, yang_name="connectivity-matrix", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='id', extensions=None), is_container='list', yang_name="connectivity-matrix", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """connectivity_matrix must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("id",connectivity_matrix.connectivity_matrix, yang_name="connectivity-matrix", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='id', extensions=None), is_container='list', yang_name="connectivity-matrix", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__connectivity_matrix = t + if hasattr(self, '_set'): + self._set() + + def _unset_connectivity_matrix(self): + self.__connectivity_matrix = YANGDynClass(base=YANGListType("id",connectivity_matrix.connectivity_matrix, yang_name="connectivity-matrix", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='id', extensions=None), is_container='list', yang_name="connectivity-matrix", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + number_of_entries = __builtin__.property(_get_number_of_entries) + label_restrictions = __builtin__.property(_get_label_restrictions) + is_allowed = __builtin__.property(_get_is_allowed) + underlay = __builtin__.property(_get_underlay) + path_constraints = __builtin__.property(_get_path_constraints) + optimizations = __builtin__.property(_get_optimizations) + path_properties = __builtin__.property(_get_path_properties) + connectivity_matrix = __builtin__.property(_get_connectivity_matrix) + + + _pyangbind_elements = OrderedDict([('number_of_entries', number_of_entries), ('label_restrictions', label_restrictions), ('is_allowed', is_allowed), ('underlay', underlay), ('path_constraints', path_constraints), ('optimizations', optimizations), ('path_properties', path_properties), ('connectivity_matrix', connectivity_matrix), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/__init__.py new file mode 100644 index 000000000..edc6885b3 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/__init__.py @@ -0,0 +1,405 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import from_ +from . import to +from . import underlay +from . import path_constraints +from . import optimizations +from . import path_properties +class connectivity_matrix(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Represents a node's switching limitations, i.e., +limitations in the interconnecting network TE links +across the node. + """ + __slots__ = ('_path_helper', '_extmethods', '__id','__from_','__to','__is_allowed','__underlay','__path_constraints','__optimizations','__path_properties',) + + _yang_name = 'connectivity-matrix' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__from_ = YANGDynClass(base=from_.from_, is_container='container', yang_name="from", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__to = YANGDynClass(base=to.to, is_container='container', yang_name="to", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__is_allowed = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + self.__underlay = YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_constraints = YANGDynClass(base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__optimizations = YANGDynClass(base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_properties = YANGDynClass(base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix'] + + def _get_id(self): + """ + Getter method for id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/id (uint32) + + YANG Description: Identifies the connectivity matrix entry. + """ + return self.__id + + def _set_id(self, v, load=False): + """ + Setter method for id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_id() directly. + + YANG Description: Identifies the connectivity matrix entry. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """id must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False)""", + }) + + self.__id = t + if hasattr(self, '_set'): + self._set() + + def _unset_id(self): + self.__id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_from_(self): + """ + Getter method for from_, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from (container) + + YANG Description: Reference to a source LTP. + """ + return self.__from_ + + def _set_from_(self, v, load=False): + """ + Setter method for from_, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_from_ is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_from_() directly. + + YANG Description: Reference to a source LTP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=from_.from_, is_container='container', yang_name="from", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """from_ must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=from_.from_, is_container='container', yang_name="from", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__from_ = t + if hasattr(self, '_set'): + self._set() + + def _unset_from_(self): + self.__from_ = YANGDynClass(base=from_.from_, is_container='container', yang_name="from", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_to(self): + """ + Getter method for to, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to (container) + + YANG Description: Reference to a destination LTP. + """ + return self.__to + + def _set_to(self, v, load=False): + """ + Setter method for to, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_to is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_to() directly. + + YANG Description: Reference to a destination LTP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=to.to, is_container='container', yang_name="to", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """to must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=to.to, is_container='container', yang_name="to", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__to = t + if hasattr(self, '_set'): + self._set() + + def _unset_to(self): + self.__to = YANGDynClass(base=to.to, is_container='container', yang_name="to", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_is_allowed(self): + """ + Getter method for is_allowed, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/is_allowed (boolean) + + YANG Description: 'true' - switching is allowed; +'false' - switching is disallowed. + """ + return self.__is_allowed + + def _set_is_allowed(self, v, load=False): + """ + Setter method for is_allowed, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/is_allowed (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_is_allowed is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_is_allowed() directly. + + YANG Description: 'true' - switching is allowed; +'false' - switching is disallowed. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """is_allowed must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False)""", + }) + + self.__is_allowed = t + if hasattr(self, '_set'): + self._set() + + def _unset_is_allowed(self): + self.__is_allowed = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + + + def _get_underlay(self): + """ + Getter method for underlay, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay (container) + + YANG Description: Attributes of the TE link underlay. + """ + return self.__underlay + + def _set_underlay(self, v, load=False): + """ + Setter method for underlay, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_underlay is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_underlay() directly. + + YANG Description: Attributes of the TE link underlay. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """underlay must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__underlay = t + if hasattr(self, '_set'): + self._set() + + def _unset_underlay(self): + self.__underlay = YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_constraints(self): + """ + Getter method for path_constraints, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints (container) + + YANG Description: TE named path constraints container. + """ + return self.__path_constraints + + def _set_path_constraints(self, v, load=False): + """ + Setter method for path_constraints, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_constraints is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_constraints() directly. + + YANG Description: TE named path constraints container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_constraints must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_constraints = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_constraints(self): + self.__path_constraints = YANGDynClass(base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_optimizations(self): + """ + Getter method for optimizations, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations (container) + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + return self.__optimizations + + def _set_optimizations(self, v, load=False): + """ + Setter method for optimizations, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_optimizations is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_optimizations() directly. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """optimizations must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__optimizations = t + if hasattr(self, '_set'): + self._set() + + def _unset_optimizations(self): + self.__optimizations = YANGDynClass(base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_properties(self): + """ + Getter method for path_properties, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties (container) + + YANG Description: The TE path properties. + """ + return self.__path_properties + + def _set_path_properties(self, v, load=False): + """ + Setter method for path_properties, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_properties is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_properties() directly. + + YANG Description: The TE path properties. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_properties must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_properties = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_properties(self): + self.__path_properties = YANGDynClass(base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + id = __builtin__.property(_get_id) + from_ = __builtin__.property(_get_from_) + to = __builtin__.property(_get_to) + is_allowed = __builtin__.property(_get_is_allowed) + underlay = __builtin__.property(_get_underlay) + path_constraints = __builtin__.property(_get_path_constraints) + optimizations = __builtin__.property(_get_optimizations) + path_properties = __builtin__.property(_get_path_properties) + + + _pyangbind_elements = OrderedDict([('id', id), ('from_', from_), ('to', to), ('is_allowed', is_allowed), ('underlay', underlay), ('path_constraints', path_constraints), ('optimizations', optimizations), ('path_properties', path_properties), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/__init__.py new file mode 100644 index 000000000..8769c9ff8 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/__init__.py @@ -0,0 +1,155 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import label_restrictions +class from_(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/from. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Reference to a source LTP. + """ + __slots__ = ('_path_helper', '_extmethods', '__tp_ref','__label_restrictions',) + + _yang_name = 'from' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tp_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + self.__label_restrictions = YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'from'] + + def _get_tp_ref(self): + """ + Getter method for tp_ref, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/tp_ref (leafref) + + YANG Description: Relative reference to a termination point. + """ + return self.__tp_ref + + def _set_tp_ref(self, v, load=False): + """ + Setter method for tp_ref, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/tp_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tp_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tp_ref() directly. + + YANG Description: Relative reference to a termination point. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tp_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False)""", + }) + + self.__tp_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_tp_ref(self): + self.__tp_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + + + def _get_label_restrictions(self): + """ + Getter method for label_restrictions, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions (container) + + YANG Description: The label restrictions container. + """ + return self.__label_restrictions + + def _set_label_restrictions(self, v, load=False): + """ + Setter method for label_restrictions, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_restrictions is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_restrictions() directly. + + YANG Description: The label restrictions container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_restrictions must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_restrictions = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_restrictions(self): + self.__label_restrictions = YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + tp_ref = __builtin__.property(_get_tp_ref) + label_restrictions = __builtin__.property(_get_label_restrictions) + + + _pyangbind_elements = OrderedDict([('tp_ref', tp_ref), ('label_restrictions', label_restrictions), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/__init__.py new file mode 100644 index 000000000..90df40ae3 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/__init__.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import label_restriction +class label_restrictions(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/from/label-restrictions. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The label restrictions container. + """ + __slots__ = ('_path_helper', '_extmethods', '__label_restriction',) + + _yang_name = 'label-restrictions' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__label_restriction = YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions'] + + def _get_label_restriction(self): + """ + Getter method for label_restriction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction (list) + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + return self.__label_restriction + + def _set_label_restriction(self, v, load=False): + """ + Setter method for label_restriction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_restriction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_restriction() directly. + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_restriction must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__label_restriction = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_restriction(self): + self.__label_restriction = YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + label_restriction = __builtin__.property(_get_label_restriction) + + + _pyangbind_elements = OrderedDict([('label_restriction', label_restriction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/__init__.py new file mode 100644 index 000000000..325db1710 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/__init__.py @@ -0,0 +1,450 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import label_start +from . import label_end +from . import label_step +from . import otn_label_range +from . import ethernet_label_range +class label_restriction(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/from/label-restrictions/label-restriction. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + __slots__ = ('_path_helper', '_extmethods', '__restriction','__index','__label_start','__label_end','__label_step','__range_bitmap','__otn_label_range','__ethernet_label_range',) + + _yang_name = 'label-restriction' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__restriction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=False) + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__label_start = YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__label_end = YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__label_step = YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__range_bitmap = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=False) + self.__otn_label_range = YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__ethernet_label_range = YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions', 'label-restriction'] + + def _get_restriction(self): + """ + Getter method for restriction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/restriction (enumeration) + + YANG Description: Indicates whether the list item is inclusive or exclusive. + """ + return self.__restriction + + def _set_restriction(self, v, load=False): + """ + Setter method for restriction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/restriction (enumeration) + If this variable is read-only (config: false) in the + source YANG file, then _set_restriction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_restriction() directly. + + YANG Description: Indicates whether the list item is inclusive or exclusive. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """restriction must be of a type compatible with enumeration""", + 'defined-type': "ietf-te-topology:enumeration", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=False)""", + }) + + self.__restriction = t + if hasattr(self, '_set'): + self._set() + + def _unset_restriction(self): + self.__restriction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=False) + + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/index (uint32) + + YANG Description: The index of the label restriction list entry. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/index (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: The index of the label restriction list entry. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_label_start(self): + """ + Getter method for label_start, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start (container) + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + return self.__label_start + + def _set_label_start(self, v, load=False): + """ + Setter method for label_start, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_start is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_start() directly. + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_start must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_start = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_start(self): + self.__label_start = YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_label_end(self): + """ + Getter method for label_end, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end (container) + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + return self.__label_end + + def _set_label_end(self, v, load=False): + """ + Setter method for label_end, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_end is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_end() directly. + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_end must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_end = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_end(self): + self.__label_end = YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_label_step(self): + """ + Getter method for label_step, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step (container) + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + return self.__label_step + + def _set_label_step(self, v, load=False): + """ + Setter method for label_step, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_step is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_step() directly. + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_step must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_step = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_step(self): + self.__label_step = YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_range_bitmap(self): + """ + Getter method for range_bitmap, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/range_bitmap (yang:hex-string) + + YANG Description: When there are gaps between 'label-start' and 'label-end', +this attribute is used to specify the positions +of the used labels. This is represented in big endian as +'hex-string'. +The most significant byte in the hex-string is the farthest +to the left in the byte sequence. Leading zero bytes in the +configured value may be omitted for brevity. +Each bit position in the 'range-bitmap' 'hex-string' maps +to a label in the range derived from 'label-start'. + +For example, assuming that 'label-start' = 16000 and +'range-bitmap' = 0x01000001, then: + +- bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. +- bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1. + """ + return self.__range_bitmap + + def _set_range_bitmap(self, v, load=False): + """ + Setter method for range_bitmap, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/range_bitmap (yang:hex-string) + If this variable is read-only (config: false) in the + source YANG file, then _set_range_bitmap is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_range_bitmap() directly. + + YANG Description: When there are gaps between 'label-start' and 'label-end', +this attribute is used to specify the positions +of the used labels. This is represented in big endian as +'hex-string'. +The most significant byte in the hex-string is the farthest +to the left in the byte sequence. Leading zero bytes in the +configured value may be omitted for brevity. +Each bit position in the 'range-bitmap' 'hex-string' maps +to a label in the range derived from 'label-start'. + +For example, assuming that 'label-start' = 16000 and +'range-bitmap' = 0x01000001, then: + +- bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. +- bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """range_bitmap must be of a type compatible with yang:hex-string""", + 'defined-type': "yang:hex-string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=False)""", + }) + + self.__range_bitmap = t + if hasattr(self, '_set'): + self._set() + + def _unset_range_bitmap(self): + self.__range_bitmap = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=False) + + + def _get_otn_label_range(self): + """ + Getter method for otn_label_range, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/otn_label_range (container) + + YANG Description: Label range information for OTN. + """ + return self.__otn_label_range + + def _set_otn_label_range(self, v, load=False): + """ + Setter method for otn_label_range, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/otn_label_range (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn_label_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn_label_range() directly. + + YANG Description: Label range information for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn_label_range must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn_label_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn_label_range(self): + self.__otn_label_range = YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_ethernet_label_range(self): + """ + Getter method for ethernet_label_range, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/ethernet_label_range (container) + + YANG Description: Ethernet-specific label range related information. + """ + return self.__ethernet_label_range + + def _set_ethernet_label_range(self, v, load=False): + """ + Setter method for ethernet_label_range, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/ethernet_label_range (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_ethernet_label_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ethernet_label_range() directly. + + YANG Description: Ethernet-specific label range related information. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ethernet_label_range must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=False)""", + }) + + self.__ethernet_label_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_ethernet_label_range(self): + self.__ethernet_label_range = YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=False) + + restriction = __builtin__.property(_get_restriction) + index = __builtin__.property(_get_index) + label_start = __builtin__.property(_get_label_start) + label_end = __builtin__.property(_get_label_end) + label_step = __builtin__.property(_get_label_step) + range_bitmap = __builtin__.property(_get_range_bitmap) + otn_label_range = __builtin__.property(_get_otn_label_range) + ethernet_label_range = __builtin__.property(_get_ethernet_label_range) + + + _pyangbind_elements = OrderedDict([('restriction', restriction), ('index', index), ('label_start', label_start), ('label_end', label_end), ('label_step', label_step), ('range_bitmap', range_bitmap), ('otn_label_range', otn_label_range), ('ethernet_label_range', ethernet_label_range), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/ethernet_label_range/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/ethernet_label_range/__init__.py new file mode 100644 index 000000000..ccc0a8bf9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/ethernet_label_range/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class ethernet_label_range(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/from/label-restrictions/label-restriction/ethernet-label-range. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Ethernet-specific label range related information. + """ + __slots__ = ('_path_helper', '_extmethods', '__tag_type','__priority',) + + _yang_name = 'ethernet-label-range' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tag_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=False) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions', 'label-restriction', 'ethernet-label-range'] + + def _get_tag_type(self): + """ + Getter method for tag_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/ethernet_label_range/tag_type (etht-types:eth-tag-type) + + YANG Description: VLAN tag type. + """ + return self.__tag_type + + def _set_tag_type(self, v, load=False): + """ + Setter method for tag_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/ethernet_label_range/tag_type (etht-types:eth-tag-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_tag_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tag_type() directly. + + YANG Description: VLAN tag type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tag_type must be of a type compatible with etht-types:eth-tag-type""", + 'defined-type': "etht-types:eth-tag-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=False)""", + }) + + self.__tag_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_tag_type(self): + self.__tag_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=False) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/ethernet_label_range/priority (uint8) + + YANG Description: priority. + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/ethernet_label_range/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: priority. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=False)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=False) + + tag_type = __builtin__.property(_get_tag_type) + priority = __builtin__.property(_get_priority) + + + _pyangbind_elements = OrderedDict([('tag_type', tag_type), ('priority', priority), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_end/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_end/__init__.py new file mode 100644 index 000000000..8116db8f3 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_end/__init__.py @@ -0,0 +1,119 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_end(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/from/label-restrictions/label-restriction/label-end. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-end' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions', 'label-restriction', 'label-end'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_label = __builtin__.property(_get_te_label) + + + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_end/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_end/te_label/__init__.py new file mode 100644 index 000000000..7d689d60a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_end/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/from/label-restrictions/label-restriction/label-end/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions', 'label-restriction', 'label-end', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/otn (container) + + YANG Description: Label start or label end for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label start or label end for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + vlanid = __builtin__.property(_get_vlanid) + direction = __builtin__.property(_get_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py new file mode 100644 index 000000000..3dbff3b16 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/from/label-restrictions/label-restriction/label-end/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label start or label end for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions', 'label-restriction', 'label-end', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/otn/ts (otn-ts) + + YANG Description: Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + + tpn = __builtin__.property(_get_tpn) + ts = __builtin__.property(_get_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_start/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_start/__init__.py new file mode 100644 index 000000000..c682b45e5 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_start/__init__.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_start(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/from/label-restrictions/label-restriction/label-start. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-start' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions', 'label-restriction', 'label-start'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_label = __builtin__.property(_get_te_label) + + + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_start/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_start/te_label/__init__.py new file mode 100644 index 000000000..3d28ae831 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_start/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/from/label-restrictions/label-restriction/label-start/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions', 'label-restriction', 'label-start', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/otn (container) + + YANG Description: Label start or label end for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label start or label end for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + vlanid = __builtin__.property(_get_vlanid) + direction = __builtin__.property(_get_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py new file mode 100644 index 000000000..458413ca8 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/from/label-restrictions/label-restriction/label-start/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label start or label end for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions', 'label-restriction', 'label-start', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/otn/ts (otn-ts) + + YANG Description: Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + + tpn = __builtin__.property(_get_tpn) + ts = __builtin__.property(_get_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_step/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_step/__init__.py new file mode 100644 index 000000000..817c68ae2 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_step/__init__.py @@ -0,0 +1,200 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class label_step(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/from/label-restrictions/label-restriction/label-step. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_step',) + + _yang_name = 'label-step' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__eth_step = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions', 'label-restriction', 'label-step'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/generic (int32) + + YANG Description: Label range step. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/generic (int32) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Label range step. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with int32""", + 'defined-type': "int32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/otn (container) + + YANG Description: Label step for OTN + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label step for OTN + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_eth_step(self): + """ + Getter method for eth_step, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/eth_step (uint16) + + YANG Description: Label step which represent possible increments for +an Ethernet VLAN tag. + """ + return self.__eth_step + + def _set_eth_step(self, v, load=False): + """ + Setter method for eth_step, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/eth_step (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_step is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_step() directly. + + YANG Description: Label step which represent possible increments for +an Ethernet VLAN tag. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_step must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=False)""", + }) + + self.__eth_step = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_step(self): + self.__eth_step = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + eth_step = __builtin__.property(_get_eth_step) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['eth_step']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_step', eth_step), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_step/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_step/otn/__init__.py new file mode 100644 index 000000000..715687de9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_step/otn/__init__.py @@ -0,0 +1,158 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/from/label-restrictions/label-restriction/label-step/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label step for OTN + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions', 'label-restriction', 'label-step', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/otn/tpn (otn-tpn) + + YANG Description: Label step which represents possible increments for +Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Label step which represents possible increments for +Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/otn/ts (otn-ts) + + YANG Description: Label step which represents possible increments for +Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Label step which represents possible increments for +Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + + tpn = __builtin__.property(_get_tpn) + ts = __builtin__.property(_get_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/otn_label_range/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/otn_label_range/__init__.py new file mode 100644 index 000000000..82fc8d6a1 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/otn_label_range/__init__.py @@ -0,0 +1,256 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn_label_range(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/from/label-restrictions/label-restriction/otn-label-range. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label range information for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__range_type','__tsg','__odu_type_list','__priority',) + + _yang_name = 'otn-label-range' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__range_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=False) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__odu_type_list = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions', 'label-restriction', 'otn-label-range'] + + def _get_range_type(self): + """ + Getter method for range_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/otn_label_range/range_type (otn-label-range-type) + + YANG Description: The type of range (e.g., TPN or TS) +to which the label range applies + """ + return self.__range_type + + def _set_range_type(self, v, load=False): + """ + Setter method for range_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/otn_label_range/range_type (otn-label-range-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_range_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_range_type() directly. + + YANG Description: The type of range (e.g., TPN or TS) +to which the label range applies + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """range_type must be of a type compatible with otn-label-range-type""", + 'defined-type': "ietf-otn-topology:otn-label-range-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=False)""", + }) + + self.__range_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_range_type(self): + self.__range_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=False) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/otn_label_range/tsg (identityref) + + YANG Description: Tributary slot granularity (TSG) to which the label range +applies. + +This leaf MUST be present when the range-type is TS. + +This leaf MAY be omitted when mapping an ODUk over an OTUk +Link. In this case the range-type is tpn, with only one +entry (ODUk), and the tpn range has only one value (1). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/otn_label_range/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary slot granularity (TSG) to which the label range +applies. + +This leaf MUST be present when the range-type is TS. + +This leaf MAY be omitted when mapping an ODUk over an OTUk +Link. In this case the range-type is tpn, with only one +entry (ODUk), and the tpn range has only one value (1). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_odu_type_list(self): + """ + Getter method for odu_type_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/otn_label_range/odu_type_list (identityref) + + YANG Description: List of ODU types to which the label range applies. + +An Empty odu-type-list means that the label range +applies to all the supported ODU types. + """ + return self.__odu_type_list + + def _set_odu_type_list(self, v, load=False): + """ + Setter method for odu_type_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/otn_label_range/odu_type_list (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type_list() directly. + + YANG Description: List of ODU types to which the label range applies. + +An Empty odu-type-list means that the label range +applies to all the supported ODU types. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type_list must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__odu_type_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type_list(self): + self.__odu_type_list = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/otn_label_range/priority (uint8) + + YANG Description: Priority in Interface Switching Capability +Descriptor (ISCD). + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/otn_label_range/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: Priority in Interface Switching Capability +Descriptor (ISCD). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=False)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=False) + + range_type = __builtin__.property(_get_range_type) + tsg = __builtin__.property(_get_tsg) + odu_type_list = __builtin__.property(_get_odu_type_list) + priority = __builtin__.property(_get_priority) + + + _pyangbind_elements = OrderedDict([('range_type', range_type), ('tsg', tsg), ('odu_type_list', odu_type_list), ('priority', priority), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/__init__.py new file mode 100644 index 000000000..ff0a5fab9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/__init__.py @@ -0,0 +1,199 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import optimization_metric +from . import tiebreakers +from . import objective_function +class optimizations(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + __slots__ = ('_path_helper', '_extmethods', '__optimization_metric','__tiebreakers','__objective_function',) + + _yang_name = 'optimizations' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__optimization_metric = YANGDynClass(base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + self.__tiebreakers = YANGDynClass(base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__objective_function = YANGDynClass(base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations'] + + def _get_optimization_metric(self): + """ + Getter method for optimization_metric, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric (list) + + YANG Description: TE path metric type. + """ + return self.__optimization_metric + + def _set_optimization_metric(self, v, load=False): + """ + Setter method for optimization_metric, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_optimization_metric is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_optimization_metric() directly. + + YANG Description: TE path metric type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """optimization_metric must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__optimization_metric = t + if hasattr(self, '_set'): + self._set() + + def _unset_optimization_metric(self): + self.__optimization_metric = YANGDynClass(base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + + def _get_tiebreakers(self): + """ + Getter method for tiebreakers, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers (container) + + YANG Description: Container for the list of tiebreakers. + """ + return self.__tiebreakers + + def _set_tiebreakers(self, v, load=False): + """ + Setter method for tiebreakers, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tiebreakers is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tiebreakers() directly. + + YANG Description: Container for the list of tiebreakers. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tiebreakers must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__tiebreakers = t + if hasattr(self, '_set'): + self._set() + + def _unset_tiebreakers(self): + self.__tiebreakers = YANGDynClass(base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_objective_function(self): + """ + Getter method for objective_function, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/objective_function (container) + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + return self.__objective_function + + def _set_objective_function(self, v, load=False): + """ + Setter method for objective_function, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/objective_function (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_objective_function is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_objective_function() directly. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """objective_function must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__objective_function = t + if hasattr(self, '_set'): + self._set() + + def _unset_objective_function(self): + self.__objective_function = YANGDynClass(base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + optimization_metric = __builtin__.property(_get_optimization_metric) + tiebreakers = __builtin__.property(_get_tiebreakers) + objective_function = __builtin__.property(_get_objective_function) + + __choices__ = {'algorithm': {'metric': ['optimization_metric', 'tiebreakers'], 'objective-function': ['objective_function']}} + _pyangbind_elements = OrderedDict([('optimization_metric', optimization_metric), ('tiebreakers', tiebreakers), ('objective_function', objective_function), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/objective_function/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/objective_function/__init__.py new file mode 100644 index 000000000..a9fdbbbf6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/objective_function/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class objective_function(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/objective-function. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + __slots__ = ('_path_helper', '_extmethods', '__objective_function_type',) + + _yang_name = 'objective-function' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__objective_function_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'objective-function'] + + def _get_objective_function_type(self): + """ + Getter method for objective_function_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/objective_function/objective_function_type (identityref) + + YANG Description: Objective function entry. + """ + return self.__objective_function_type + + def _set_objective_function_type(self, v, load=False): + """ + Setter method for objective_function_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/objective_function/objective_function_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_objective_function_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_objective_function_type() directly. + + YANG Description: Objective function entry. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """objective_function_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__objective_function_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_objective_function_type(self): + self.__objective_function_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + objective_function_type = __builtin__.property(_get_objective_function_type) + + __choices__ = {'algorithm': {'objective-function': ['objective_function_type']}} + _pyangbind_elements = OrderedDict([('objective_function_type', objective_function_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/__init__.py new file mode 100644 index 000000000..74c142e28 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/__init__.py @@ -0,0 +1,241 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import explicit_route_exclude_objects +from . import explicit_route_include_objects +class optimization_metric(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE path metric type. + """ + __slots__ = ('_path_helper', '_extmethods', '__metric_type','__weight','__explicit_route_exclude_objects','__explicit_route_include_objects',) + + _yang_name = 'optimization-metric' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__weight = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + self.__explicit_route_exclude_objects = YANGDynClass(base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__explicit_route_include_objects = YANGDynClass(base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric'] + + def _get_metric_type(self): + """ + Getter method for metric_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/metric_type (identityref) + + YANG Description: Identifies the 'metric-type' that the path computation +process uses for optimization. + """ + return self.__metric_type + + def _set_metric_type(self, v, load=False): + """ + Setter method for metric_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/metric_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_metric_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_metric_type() directly. + + YANG Description: Identifies the 'metric-type' that the path computation +process uses for optimization. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """metric_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__metric_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_metric_type(self): + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_weight(self): + """ + Getter method for weight, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/weight (uint8) + + YANG Description: TE path metric normalization weight. + """ + return self.__weight + + def _set_weight(self, v, load=False): + """ + Setter method for weight, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/weight (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_weight is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_weight() directly. + + YANG Description: TE path metric normalization weight. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """weight must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False)""", + }) + + self.__weight = t + if hasattr(self, '_set'): + self._set() + + def _unset_weight(self): + self.__weight = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + + + def _get_explicit_route_exclude_objects(self): + """ + Getter method for explicit_route_exclude_objects, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects (container) + + YANG Description: Container for the 'exclude route' object list. + """ + return self.__explicit_route_exclude_objects + + def _set_explicit_route_exclude_objects(self, v, load=False): + """ + Setter method for explicit_route_exclude_objects, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_explicit_route_exclude_objects is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_explicit_route_exclude_objects() directly. + + YANG Description: Container for the 'exclude route' object list. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """explicit_route_exclude_objects must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__explicit_route_exclude_objects = t + if hasattr(self, '_set'): + self._set() + + def _unset_explicit_route_exclude_objects(self): + self.__explicit_route_exclude_objects = YANGDynClass(base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_explicit_route_include_objects(self): + """ + Getter method for explicit_route_include_objects, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects (container) + + YANG Description: Container for the 'include route' object list. + """ + return self.__explicit_route_include_objects + + def _set_explicit_route_include_objects(self, v, load=False): + """ + Setter method for explicit_route_include_objects, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_explicit_route_include_objects is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_explicit_route_include_objects() directly. + + YANG Description: Container for the 'include route' object list. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """explicit_route_include_objects must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__explicit_route_include_objects = t + if hasattr(self, '_set'): + self._set() + + def _unset_explicit_route_include_objects(self): + self.__explicit_route_include_objects = YANGDynClass(base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + metric_type = __builtin__.property(_get_metric_type) + weight = __builtin__.property(_get_weight) + explicit_route_exclude_objects = __builtin__.property(_get_explicit_route_exclude_objects) + explicit_route_include_objects = __builtin__.property(_get_explicit_route_include_objects) + + __choices__ = {'algorithm': {'metric': ['metric_type', 'weight', 'explicit_route_exclude_objects', 'explicit_route_include_objects']}} + _pyangbind_elements = OrderedDict([('metric_type', metric_type), ('weight', weight), ('explicit_route_exclude_objects', explicit_route_exclude_objects), ('explicit_route_include_objects', explicit_route_include_objects), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/__init__.py new file mode 100644 index 000000000..ed88eea05 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import route_object_exclude_object +class explicit_route_exclude_objects(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-exclude-objects. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the 'exclude route' object list. + """ + __slots__ = ('_path_helper', '_extmethods', '__route_object_exclude_object',) + + _yang_name = 'explicit-route-exclude-objects' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__route_object_exclude_object = YANGDynClass(base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects'] + + def _get_route_object_exclude_object(self): + """ + Getter method for route_object_exclude_object, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object (list) + + YANG Description: List of Explicit Route Objects to be excluded in the +path computation. + """ + return self.__route_object_exclude_object + + def _set_route_object_exclude_object(self, v, load=False): + """ + Setter method for route_object_exclude_object, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_route_object_exclude_object is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_route_object_exclude_object() directly. + + YANG Description: List of Explicit Route Objects to be excluded in the +path computation. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """route_object_exclude_object must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__route_object_exclude_object = t + if hasattr(self, '_set'): + self._set() + + def _unset_route_object_exclude_object(self): + self.__route_object_exclude_object = YANGDynClass(base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + route_object_exclude_object = __builtin__.property(_get_route_object_exclude_object) + + __choices__ = {'algorithm': {'metric': ['route_object_exclude_object']}} + _pyangbind_elements = OrderedDict([('route_object_exclude_object', route_object_exclude_object), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py new file mode 100644 index 000000000..ad5bff3e1 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py @@ -0,0 +1,365 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +from . import srlg +class route_object_exclude_object(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of Explicit Route Objects to be excluded in the +path computation. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop','__srlg',) + + _yang_name = 'route-object-exclude-object' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__srlg = YANGDynClass(base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/index (uint32) + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/index (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_srlg(self): + """ + Getter method for srlg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg (container) + + YANG Description: SRLG container. + """ + return self.__srlg + + def _set_srlg(self, v, load=False): + """ + Setter method for srlg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_srlg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_srlg() directly. + + YANG Description: SRLG container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """srlg must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__srlg = t + if hasattr(self, '_set'): + self._set() + + def _unset_srlg(self): + self.__srlg = YANGDynClass(base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + index = __builtin__.property(_get_index) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop) + label_hop = __builtin__.property(_get_label_hop) + srlg = __builtin__.property(_get_srlg) + + __choices__ = {'algorithm': {'metric': ['index']}, 'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop'], 'srlg': ['srlg']}} + _pyangbind_elements = OrderedDict([('index', index), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ('srlg', srlg), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/__init__.py new file mode 100644 index 000000000..40a38d18d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + as_number = __builtin__.property(_get_as_number) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/__init__.py new file mode 100644 index 000000000..d86889be2 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_label = __builtin__.property(_get_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/__init__.py new file mode 100644 index 000000000..b404a2341 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + vlanid = __builtin__.property(_get_vlanid) + direction = __builtin__.property(_get_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/__init__.py new file mode 100644 index 000000000..fbabbb174 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + + tpn = __builtin__.property(_get_tpn) + tsg = __builtin__.property(_get_tsg) + ts_list = __builtin__.property(_get_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/__init__.py new file mode 100644 index 000000000..4a9ce25d0 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/__init__.py new file mode 100644 index 000000000..81ae5ee3b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/__init__.py new file mode 100644 index 000000000..ba86eb284 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/__init__.py @@ -0,0 +1,115 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class srlg(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/srlg. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: SRLG container. + """ + __slots__ = ('_path_helper', '_extmethods', '__srlg',) + + _yang_name = 'srlg' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__srlg = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'srlg'] + + def _get_srlg(self): + """ + Getter method for srlg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/srlg (uint32) + + YANG Description: SRLG value. + """ + return self.__srlg + + def _set_srlg(self, v, load=False): + """ + Setter method for srlg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/srlg (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_srlg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_srlg() directly. + + YANG Description: SRLG value. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """srlg must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False)""", + }) + + self.__srlg = t + if hasattr(self, '_set'): + self._set() + + def _unset_srlg(self): + self.__srlg = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + srlg = __builtin__.property(_get_srlg) + + __choices__ = {'type': {'srlg': ['srlg']}} + _pyangbind_elements = OrderedDict([('srlg', srlg), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/__init__.py new file mode 100644 index 000000000..edb8b9e25 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/__init__.py new file mode 100644 index 000000000..21986a912 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import route_object_include_object +class explicit_route_include_objects(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-include-objects. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the 'include route' object list. + """ + __slots__ = ('_path_helper', '_extmethods', '__route_object_include_object',) + + _yang_name = 'explicit-route-include-objects' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__route_object_include_object = YANGDynClass(base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-include-objects'] + + def _get_route_object_include_object(self): + """ + Getter method for route_object_include_object, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object (list) + + YANG Description: List of Explicit Route Objects to be included in the +path computation. + """ + return self.__route_object_include_object + + def _set_route_object_include_object(self, v, load=False): + """ + Setter method for route_object_include_object, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_route_object_include_object is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_route_object_include_object() directly. + + YANG Description: List of Explicit Route Objects to be included in the +path computation. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """route_object_include_object must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__route_object_include_object = t + if hasattr(self, '_set'): + self._set() + + def _unset_route_object_include_object(self): + self.__route_object_include_object = YANGDynClass(base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + route_object_include_object = __builtin__.property(_get_route_object_include_object) + + __choices__ = {'algorithm': {'metric': ['route_object_include_object']}} + _pyangbind_elements = OrderedDict([('route_object_include_object', route_object_include_object), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py new file mode 100644 index 000000000..5140272ee --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py @@ -0,0 +1,325 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class route_object_include_object(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of Explicit Route Objects to be included in the +path computation. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'route-object-include-object' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/index (uint32) + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/index (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + index = __builtin__.property(_get_index) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop) + label_hop = __builtin__.property(_get_label_hop) + + __choices__ = {'algorithm': {'metric': ['index']}, 'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('index', index), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/__init__.py new file mode 100644 index 000000000..0f65b4645 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + as_number = __builtin__.property(_get_as_number) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/__init__.py new file mode 100644 index 000000000..882e1f01a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_label = __builtin__.property(_get_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/__init__.py new file mode 100644 index 000000000..2dde61c31 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + vlanid = __builtin__.property(_get_vlanid) + direction = __builtin__.property(_get_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/__init__.py new file mode 100644 index 000000000..784b431b6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + + tpn = __builtin__.property(_get_tpn) + tsg = __builtin__.property(_get_tsg) + ts_list = __builtin__.property(_get_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/__init__.py new file mode 100644 index 000000000..14455045c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/__init__.py new file mode 100644 index 000000000..70eea9f9a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/__init__.py new file mode 100644 index 000000000..eb61c881e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers/__init__.py new file mode 100644 index 000000000..8c6d93527 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers/__init__.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import tiebreaker +class tiebreakers(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/tiebreakers. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of tiebreakers. + """ + __slots__ = ('_path_helper', '_extmethods', '__tiebreaker',) + + _yang_name = 'tiebreakers' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tiebreaker = YANGDynClass(base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'tiebreakers'] + + def _get_tiebreaker(self): + """ + Getter method for tiebreaker, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers/tiebreaker (list) + + YANG Description: The list of tiebreaker criteria to apply on an +equally favored set of paths, in order to pick +the best. + """ + return self.__tiebreaker + + def _set_tiebreaker(self, v, load=False): + """ + Setter method for tiebreaker, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers/tiebreaker (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_tiebreaker is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tiebreaker() directly. + + YANG Description: The list of tiebreaker criteria to apply on an +equally favored set of paths, in order to pick +the best. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tiebreaker must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__tiebreaker = t + if hasattr(self, '_set'): + self._set() + + def _unset_tiebreaker(self): + self.__tiebreaker = YANGDynClass(base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + tiebreaker = __builtin__.property(_get_tiebreaker) + + __choices__ = {'algorithm': {'metric': ['tiebreaker']}} + _pyangbind_elements = OrderedDict([('tiebreaker', tiebreaker), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers/tiebreaker/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers/tiebreaker/__init__.py new file mode 100644 index 000000000..52b5c81b7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers/tiebreaker/__init__.py @@ -0,0 +1,122 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class tiebreaker(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/optimizations/tiebreakers/tiebreaker. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The list of tiebreaker criteria to apply on an +equally favored set of paths, in order to pick +the best. + """ + __slots__ = ('_path_helper', '_extmethods', '__tiebreaker_type',) + + _yang_name = 'tiebreaker' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tiebreaker_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'tiebreakers', 'tiebreaker'] + + def _get_tiebreaker_type(self): + """ + Getter method for tiebreaker_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers/tiebreaker/tiebreaker_type (identityref) + + YANG Description: Identifies an entry in the list of tiebreakers. + """ + return self.__tiebreaker_type + + def _set_tiebreaker_type(self, v, load=False): + """ + Setter method for tiebreaker_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers/tiebreaker/tiebreaker_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tiebreaker_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tiebreaker_type() directly. + + YANG Description: Identifies an entry in the list of tiebreakers. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tiebreaker_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__tiebreaker_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_tiebreaker_type(self): + self.__tiebreaker_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + tiebreaker_type = __builtin__.property(_get_tiebreaker_type) + + __choices__ = {'algorithm': {'metric': ['tiebreaker_type']}} + _pyangbind_elements = OrderedDict([('tiebreaker_type', tiebreaker_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/__init__.py new file mode 100644 index 000000000..36a802786 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/__init__.py @@ -0,0 +1,523 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_bandwidth +from . import path_metric_bounds +from . import path_affinities_values +from . import path_affinity_names +from . import path_srlgs_lists +from . import path_srlgs_names +class path_constraints(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-constraints. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE named path constraints container. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_bandwidth','__link_protection','__setup_priority','__hold_priority','__signaling_type','__path_metric_bounds','__path_affinities_values','__path_affinity_names','__path_srlgs_lists','__path_srlgs_names','__disjointness',) + + _yang_name = 'path-constraints' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__link_protection = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__setup_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + self.__hold_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + self.__signaling_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__path_metric_bounds = YANGDynClass(base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__disjointness = YANGDynClass(base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints'] + + def _get_te_bandwidth(self): + """ + Getter method for te_bandwidth, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth (container) + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + return self.__te_bandwidth + + def _set_te_bandwidth(self, v, load=False): + """ + Setter method for te_bandwidth, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_bandwidth() directly. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_bandwidth(self): + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_link_protection(self): + """ + Getter method for link_protection, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/link_protection (identityref) + + YANG Description: Link protection type required for the links included +in the computed path. + """ + return self.__link_protection + + def _set_link_protection(self, v, load=False): + """ + Setter method for link_protection, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/link_protection (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_protection is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_protection() directly. + + YANG Description: Link protection type required for the links included +in the computed path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_protection must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__link_protection = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_protection(self): + self.__link_protection = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_setup_priority(self): + """ + Getter method for setup_priority, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/setup_priority (uint8) + + YANG Description: TE LSP requested setup priority. + """ + return self.__setup_priority + + def _set_setup_priority(self, v, load=False): + """ + Setter method for setup_priority, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/setup_priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_setup_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_setup_priority() directly. + + YANG Description: TE LSP requested setup priority. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """setup_priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False)""", + }) + + self.__setup_priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_setup_priority(self): + self.__setup_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + + + def _get_hold_priority(self): + """ + Getter method for hold_priority, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/hold_priority (uint8) + + YANG Description: TE LSP requested hold priority. + """ + return self.__hold_priority + + def _set_hold_priority(self, v, load=False): + """ + Setter method for hold_priority, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/hold_priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_hold_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hold_priority() directly. + + YANG Description: TE LSP requested hold priority. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hold_priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False)""", + }) + + self.__hold_priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_hold_priority(self): + self.__hold_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + + + def _get_signaling_type(self): + """ + Getter method for signaling_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/signaling_type (identityref) + + YANG Description: TE tunnel path signaling type. + """ + return self.__signaling_type + + def _set_signaling_type(self, v, load=False): + """ + Setter method for signaling_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/signaling_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_signaling_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_signaling_type() directly. + + YANG Description: TE tunnel path signaling type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """signaling_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__signaling_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_signaling_type(self): + self.__signaling_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_path_metric_bounds(self): + """ + Getter method for path_metric_bounds, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds (container) + + YANG Description: TE path metric bounds container. + """ + return self.__path_metric_bounds + + def _set_path_metric_bounds(self, v, load=False): + """ + Setter method for path_metric_bounds, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_metric_bounds is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_metric_bounds() directly. + + YANG Description: TE path metric bounds container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_metric_bounds must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_metric_bounds = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_metric_bounds(self): + self.__path_metric_bounds = YANGDynClass(base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_affinities_values(self): + """ + Getter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values (container) + + YANG Description: Path affinities represented as values. + """ + return self.__path_affinities_values + + def _set_path_affinities_values(self, v, load=False): + """ + Setter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_values() directly. + + YANG Description: Path affinities represented as values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_values must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_affinities_values = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_values(self): + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_affinity_names(self): + """ + Getter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names (container) + + YANG Description: Path affinities represented as names. + """ + return self.__path_affinity_names + + def _set_path_affinity_names(self, v, load=False): + """ + Setter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_names() directly. + + YANG Description: Path affinities represented as names. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_affinity_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_names(self): + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_srlgs_lists(self): + """ + Getter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists (container) + + YANG Description: Path SRLG properties container. + """ + return self.__path_srlgs_lists + + def _set_path_srlgs_lists(self, v, load=False): + """ + Setter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_lists is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_lists() directly. + + YANG Description: Path SRLG properties container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_lists must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_srlgs_lists = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_lists(self): + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_srlgs_names(self): + """ + Getter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names (container) + + YANG Description: Container for the list of named SRLGs. + """ + return self.__path_srlgs_names + + def _set_path_srlgs_names(self, v, load=False): + """ + Setter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_names() directly. + + YANG Description: Container for the list of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_srlgs_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_names(self): + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_disjointness(self): + """ + Getter method for disjointness, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/disjointness (te-path-disjointness) + + YANG Description: The type of resource disjointness. +When configured for a primary path, the disjointness level +applies to all secondary LSPs. When configured for a +secondary path, the disjointness level overrides the level +configured for the primary path. + """ + return self.__disjointness + + def _set_disjointness(self, v, load=False): + """ + Setter method for disjointness, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/disjointness (te-path-disjointness) + If this variable is read-only (config: false) in the + source YANG file, then _set_disjointness is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_disjointness() directly. + + YANG Description: The type of resource disjointness. +When configured for a primary path, the disjointness level +applies to all secondary LSPs. When configured for a +secondary path, the disjointness level overrides the level +configured for the primary path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """disjointness must be of a type compatible with te-path-disjointness""", + 'defined-type': "ietf-te-topology:te-path-disjointness", + 'generated-type': """YANGDynClass(base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', is_config=False)""", + }) + + self.__disjointness = t + if hasattr(self, '_set'): + self._set() + + def _unset_disjointness(self): + self.__disjointness = YANGDynClass(base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', is_config=False) + + te_bandwidth = __builtin__.property(_get_te_bandwidth) + link_protection = __builtin__.property(_get_link_protection) + setup_priority = __builtin__.property(_get_setup_priority) + hold_priority = __builtin__.property(_get_hold_priority) + signaling_type = __builtin__.property(_get_signaling_type) + path_metric_bounds = __builtin__.property(_get_path_metric_bounds) + path_affinities_values = __builtin__.property(_get_path_affinities_values) + path_affinity_names = __builtin__.property(_get_path_affinity_names) + path_srlgs_lists = __builtin__.property(_get_path_srlgs_lists) + path_srlgs_names = __builtin__.property(_get_path_srlgs_names) + disjointness = __builtin__.property(_get_disjointness) + + + _pyangbind_elements = OrderedDict([('te_bandwidth', te_bandwidth), ('link_protection', link_protection), ('setup_priority', setup_priority), ('hold_priority', hold_priority), ('signaling_type', signaling_type), ('path_metric_bounds', path_metric_bounds), ('path_affinities_values', path_affinities_values), ('path_affinity_names', path_affinity_names), ('path_srlgs_lists', path_srlgs_lists), ('path_srlgs_names', path_srlgs_names), ('disjointness', disjointness), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/__init__.py new file mode 100644 index 000000000..aec7be61a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_affinities_value +class path_affinities_values(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-constraints/path-affinities-values. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as values. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinities_value',) + + _yang_name = 'path-affinities-values' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'path-affinities-values'] + + def _get_path_affinities_value(self): + """ + Getter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinities_value + + def _set_path_affinities_value(self, v, load=False): + """ + Setter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_value() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_value must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_affinities_value = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_value(self): + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_affinities_value = __builtin__.property(_get_path_affinities_value) + + + _pyangbind_elements = OrderedDict([('path_affinities_value', path_affinities_value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value/__init__.py new file mode 100644 index 000000000..7a8d69da6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value/__init__.py @@ -0,0 +1,161 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_affinities_value(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-constraints/path-affinities-values/path-affinities-value. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__value',) + + _yang_name = 'path-affinities-value' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'path-affinities-values', 'path-affinities-value'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value/usage (identityref) + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_value(self): + """ + Getter method for value, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value/value (admin-groups) + + YANG Description: The affinity value. The default is empty. + """ + return self.__value + + def _set_value(self, v, load=False): + """ + Setter method for value, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value/value (admin-groups) + If this variable is read-only (config: false) in the + source YANG file, then _set_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_value() directly. + + YANG Description: The affinity value. The default is empty. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """value must be of a type compatible with admin-groups""", + 'defined-type': "ietf-te-topology:admin-groups", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False)""", + }) + + self.__value = t + if hasattr(self, '_set'): + self._set() + + def _unset_value(self): + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False) + + usage = __builtin__.property(_get_usage) + value = __builtin__.property(_get_value) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('value', value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/__init__.py new file mode 100644 index 000000000..ac5c598a4 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_affinity_name +class path_affinity_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-constraints/path-affinity-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as names. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinity_name',) + + _yang_name = 'path-affinity-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'path-affinity-names'] + + def _get_path_affinity_name(self): + """ + Getter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinity_name + + def _set_path_affinity_name(self, v, load=False): + """ + Setter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_name() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_name(self): + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_affinity_name = __builtin__.property(_get_path_affinity_name) + + + _pyangbind_elements = OrderedDict([('path_affinity_name', path_affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/__init__.py new file mode 100644 index 000000000..df70c3c79 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/__init__.py @@ -0,0 +1,162 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import affinity_name +class path_affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-constraints/path-affinity-names/path-affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__affinity_name',) + + _yang_name = 'path-affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'path-affinity-names', 'path-affinity-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/usage (identityref) + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_affinity_name(self): + """ + Getter method for affinity_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/affinity_name (list) + + YANG Description: List of named affinities. + """ + return self.__affinity_name + + def _set_affinity_name(self, v, load=False): + """ + Setter method for affinity_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_affinity_name() directly. + + YANG Description: List of named affinities. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_affinity_name(self): + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + usage = __builtin__.property(_get_usage) + affinity_name = __builtin__.property(_get_affinity_name) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('affinity_name', affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py new file mode 100644 index 000000000..5b69454e7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-constraints/path-affinity-names/path-affinity-name/affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinities. + """ + __slots__ = ('_path_helper', '_extmethods', '__name',) + + _yang_name = 'affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'path-affinity-names', 'path-affinity-name', 'affinity-name'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/affinity_name/name (string) + + YANG Description: Identifies a named affinity entry. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/affinity_name/name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: Identifies a named affinity entry. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + name = __builtin__.property(_get_name) + + + _pyangbind_elements = OrderedDict([('name', name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/__init__.py new file mode 100644 index 000000000..d5df4f469 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_metric_bound +class path_metric_bounds(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-constraints/path-metric-bounds. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE path metric bounds container. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_metric_bound',) + + _yang_name = 'path-metric-bounds' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_metric_bound = YANGDynClass(base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'path-metric-bounds'] + + def _get_path_metric_bound(self): + """ + Getter method for path_metric_bound, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound (list) + + YANG Description: List of TE path metric bounds. + """ + return self.__path_metric_bound + + def _set_path_metric_bound(self, v, load=False): + """ + Setter method for path_metric_bound, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_metric_bound is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_metric_bound() directly. + + YANG Description: List of TE path metric bounds. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_metric_bound must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_metric_bound = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_metric_bound(self): + self.__path_metric_bound = YANGDynClass(base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_metric_bound = __builtin__.property(_get_path_metric_bound) + + + _pyangbind_elements = OrderedDict([('path_metric_bound', path_metric_bound), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound/__init__.py new file mode 100644 index 000000000..fd7e445c0 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound/__init__.py @@ -0,0 +1,165 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_metric_bound(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-constraints/path-metric-bounds/path-metric-bound. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of TE path metric bounds. + """ + __slots__ = ('_path_helper', '_extmethods', '__metric_type','__upper_bound',) + + _yang_name = 'path-metric-bound' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__upper_bound = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'path-metric-bounds', 'path-metric-bound'] + + def _get_metric_type(self): + """ + Getter method for metric_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound/metric_type (identityref) + + YANG Description: Identifies an entry in the list of 'metric-type' items +bound for the TE path. + """ + return self.__metric_type + + def _set_metric_type(self, v, load=False): + """ + Setter method for metric_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound/metric_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_metric_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_metric_type() directly. + + YANG Description: Identifies an entry in the list of 'metric-type' items +bound for the TE path. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """metric_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__metric_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_metric_type(self): + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_upper_bound(self): + """ + Getter method for upper_bound, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound/upper_bound (uint64) + + YANG Description: Upper bound on the end-to-end TE path metric. A zero +indicates an unbounded upper limit for the specific +'metric-type'. + """ + return self.__upper_bound + + def _set_upper_bound(self, v, load=False): + """ + Setter method for upper_bound, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound/upper_bound (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_upper_bound is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_upper_bound() directly. + + YANG Description: Upper bound on the end-to-end TE path metric. A zero +indicates an unbounded upper limit for the specific +'metric-type'. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """upper_bound must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False)""", + }) + + self.__upper_bound = t + if hasattr(self, '_set'): + self._set() + + def _unset_upper_bound(self): + self.__upper_bound = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + + metric_type = __builtin__.property(_get_metric_type) + upper_bound = __builtin__.property(_get_upper_bound) + + + _pyangbind_elements = OrderedDict([('metric_type', metric_type), ('upper_bound', upper_bound), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/__init__.py new file mode 100644 index 000000000..f089523be --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_srlgs_list +class path_srlgs_lists(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-constraints/path-srlgs-lists. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path SRLG properties container. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_list',) + + _yang_name = 'path-srlgs-lists' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'path-srlgs-lists'] + + def _get_path_srlgs_list(self): + """ + Getter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list (list) + + YANG Description: List of SRLG values to be included or excluded. + """ + return self.__path_srlgs_list + + def _set_path_srlgs_list(self, v, load=False): + """ + Setter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_list() directly. + + YANG Description: List of SRLG values to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_list must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_srlgs_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_list(self): + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_srlgs_list = __builtin__.property(_get_path_srlgs_list) + + + _pyangbind_elements = OrderedDict([('path_srlgs_list', path_srlgs_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py new file mode 100644 index 000000000..b48cb25ff --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py @@ -0,0 +1,161 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_srlgs_list(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-constraints/path-srlgs-lists/path-srlgs-list. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of SRLG values to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__values',) + + _yang_name = 'path-srlgs-list' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'path-srlgs-lists', 'path-srlgs-list'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list/usage (identityref) + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_values(self): + """ + Getter method for values, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list/values (srlg) + + YANG Description: List of SRLG values. + """ + return self.__values + + def _set_values(self, v, load=False): + """ + Setter method for values, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list/values (srlg) + If this variable is read-only (config: false) in the + source YANG file, then _set_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_values() directly. + + YANG Description: List of SRLG values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """values must be of a type compatible with srlg""", + 'defined-type': "ietf-te-topology:srlg", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False)""", + }) + + self.__values = t + if hasattr(self, '_set'): + self._set() + + def _unset_values(self): + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False) + + usage = __builtin__.property(_get_usage) + values = __builtin__.property(_get_values) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('values', values), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/__init__.py new file mode 100644 index 000000000..d18d1658d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_srlgs_name +class path_srlgs_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-constraints/path-srlgs-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of named SRLGs. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_name',) + + _yang_name = 'path-srlgs-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'path-srlgs-names'] + + def _get_path_srlgs_name(self): + """ + Getter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name (list) + + YANG Description: List of named SRLGs to be included or excluded. + """ + return self.__path_srlgs_name + + def _set_path_srlgs_name(self, v, load=False): + """ + Setter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_name() directly. + + YANG Description: List of named SRLGs to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_srlgs_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_name(self): + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_srlgs_name = __builtin__.property(_get_path_srlgs_name) + + + _pyangbind_elements = OrderedDict([('path_srlgs_name', path_srlgs_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py new file mode 100644 index 000000000..cee736f24 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py @@ -0,0 +1,161 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_srlgs_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-constraints/path-srlgs-names/path-srlgs-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named SRLGs to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__names',) + + _yang_name = 'path-srlgs-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'path-srlgs-names', 'path-srlgs-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name/usage (identityref) + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_names(self): + """ + Getter method for names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name/names (string) + + YANG Description: List of named SRLGs. + """ + return self.__names + + def _set_names(self, v, load=False): + """ + Setter method for names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name/names (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_names() directly. + + YANG Description: List of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """names must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__names = t + if hasattr(self, '_set'): + self._set() + + def _unset_names(self): + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + usage = __builtin__.property(_get_usage) + names = __builtin__.property(_get_names) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('names', names), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/__init__.py new file mode 100644 index 000000000..a079dcabf --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/__init__.py @@ -0,0 +1,195 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-constraints/te-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_bandwidth',) + + _yang_name = 'te-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'te-bandwidth'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/generic (te-bandwidth) + + YANG Description: Bandwidth specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/generic (te-bandwidth) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Bandwidth specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with te-bandwidth""", + 'defined-type': "ietf-te-topology:te-bandwidth", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn (container) + + YANG Description: Bandwidth attributes for OTN links + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Bandwidth attributes for OTN links + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_eth_bandwidth(self): + """ + Getter method for eth_bandwidth, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/eth_bandwidth (uint64) + + YANG Description: Available bandwith value expressed in kilobits per second + """ + return self.__eth_bandwidth + + def _set_eth_bandwidth(self, v, load=False): + """ + Setter method for eth_bandwidth, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/eth_bandwidth (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_bandwidth() directly. + + YANG Description: Available bandwith value expressed in kilobits per second + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_bandwidth must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=False)""", + }) + + self.__eth_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_bandwidth(self): + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + eth_bandwidth = __builtin__.property(_get_eth_bandwidth) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['eth_bandwidth']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_bandwidth', eth_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/__init__.py new file mode 100644 index 000000000..6b5dd7c31 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/__init__.py @@ -0,0 +1,163 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import odulist +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-constraints/te-bandwidth/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Bandwidth attributes for OTN links + """ + __slots__ = ('_path_helper', '_extmethods', '__odulist','__odtu_flex_type',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=False) + self.__odtu_flex_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'te-bandwidth', 'otn'] + + def _get_odulist(self): + """ + Getter method for odulist, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist (list) + + YANG Description: OTN bandwidth definition + """ + return self.__odulist + + def _set_odulist(self, v, load=False): + """ + Setter method for odulist, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_odulist is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odulist() directly. + + YANG Description: OTN bandwidth definition + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odulist must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=False)""", + }) + + self.__odulist = t + if hasattr(self, '_set'): + self._set() + + def _unset_odulist(self): + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=False) + + + def _get_odtu_flex_type(self): + """ + Getter method for odtu_flex_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odtu_flex_type (l1-types:odtu-flex-type) + + YANG Description: The type of Optical Data Tributary Unit (ODTU) +whose nominal bitrate is used to compute the number of +Tributary Slots (TS) required by the ODUflex LSPs +set up along the underlay path of this OTN +connectivity matrix entry. + """ + return self.__odtu_flex_type + + def _set_odtu_flex_type(self, v, load=False): + """ + Setter method for odtu_flex_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odtu_flex_type (l1-types:odtu-flex-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_odtu_flex_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odtu_flex_type() directly. + + YANG Description: The type of Optical Data Tributary Unit (ODTU) +whose nominal bitrate is used to compute the number of +Tributary Slots (TS) required by the ODUflex LSPs +set up along the underlay path of this OTN +connectivity matrix entry. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odtu_flex_type must be of a type compatible with l1-types:odtu-flex-type""", + 'defined-type': "l1-types:odtu-flex-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=False)""", + }) + + self.__odtu_flex_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odtu_flex_type(self): + self.__odtu_flex_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=False) + + odulist = __builtin__.property(_get_odulist) + odtu_flex_type = __builtin__.property(_get_odtu_flex_type) + + __choices__ = {'technology': {'otn': ['odulist', 'odtu_flex_type']}} + _pyangbind_elements = OrderedDict([('odulist', odulist), ('odtu_flex_type', odtu_flex_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist/__init__.py new file mode 100644 index 000000000..afa750977 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist/__init__.py @@ -0,0 +1,200 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class odulist(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-constraints/te-bandwidth/otn/odulist. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: OTN bandwidth definition + """ + __slots__ = ('_path_helper', '_extmethods', '__odu_type','__number','__ts_number',) + + _yang_name = 'odulist' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'te-bandwidth', 'otn', 'odulist'] + + def _get_odu_type(self): + """ + Getter method for odu_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist/odu_type (identityref) + + YANG Description: ODU type + """ + return self.__odu_type + + def _set_odu_type(self, v, load=False): + """ + Setter method for odu_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist/odu_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type() directly. + + YANG Description: ODU type + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__odu_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type(self): + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_number(self): + """ + Getter method for number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist/number (uint16) + + YANG Description: Number of ODUs + """ + return self.__number + + def _set_number(self, v, load=False): + """ + Setter method for number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist/number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_number() directly. + + YANG Description: Number of ODUs + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False)""", + }) + + self.__number = t + if hasattr(self, '_set'): + self._set() + + def _unset_number(self): + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + + + def _get_ts_number(self): + """ + Getter method for ts_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist/ts_number (uint16) + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + return self.__ts_number + + def _set_ts_number(self, v, load=False): + """ + Setter method for ts_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist/ts_number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_number() directly. + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False)""", + }) + + self.__ts_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_number(self): + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + + odu_type = __builtin__.property(_get_odu_type) + number = __builtin__.property(_get_number) + ts_number = __builtin__.property(_get_ts_number) + + __choices__ = {'technology': {'otn': ['odu_type', 'number', 'ts_number']}} + _pyangbind_elements = OrderedDict([('odu_type', odu_type), ('number', number), ('ts_number', ts_number), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/__init__.py new file mode 100644 index 000000000..f87c34494 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/__init__.py @@ -0,0 +1,318 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_metric +from . import path_affinities_values +from . import path_affinity_names +from . import path_srlgs_lists +from . import path_srlgs_names +from . import path_route_objects +class path_properties(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-properties. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The TE path properties. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_metric','__path_affinities_values','__path_affinity_names','__path_srlgs_lists','__path_srlgs_names','__path_route_objects',) + + _yang_name = 'path-properties' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_metric = YANGDynClass(base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_route_objects = YANGDynClass(base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-properties'] + + def _get_path_metric(self): + """ + Getter method for path_metric, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_metric (list) + + YANG Description: TE path metric type. + """ + return self.__path_metric + + def _set_path_metric(self, v, load=False): + """ + Setter method for path_metric, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_metric (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_metric is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_metric() directly. + + YANG Description: TE path metric type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_metric must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_metric = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_metric(self): + self.__path_metric = YANGDynClass(base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + + def _get_path_affinities_values(self): + """ + Getter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values (container) + + YANG Description: Path affinities represented as values. + """ + return self.__path_affinities_values + + def _set_path_affinities_values(self, v, load=False): + """ + Setter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_values() directly. + + YANG Description: Path affinities represented as values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_values must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_affinities_values = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_values(self): + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_affinity_names(self): + """ + Getter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names (container) + + YANG Description: Path affinities represented as names. + """ + return self.__path_affinity_names + + def _set_path_affinity_names(self, v, load=False): + """ + Setter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_names() directly. + + YANG Description: Path affinities represented as names. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_affinity_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_names(self): + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_srlgs_lists(self): + """ + Getter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists (container) + + YANG Description: Path SRLG properties container. + """ + return self.__path_srlgs_lists + + def _set_path_srlgs_lists(self, v, load=False): + """ + Setter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_lists is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_lists() directly. + + YANG Description: Path SRLG properties container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_lists must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_srlgs_lists = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_lists(self): + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_srlgs_names(self): + """ + Getter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names (container) + + YANG Description: Container for the list of named SRLGs. + """ + return self.__path_srlgs_names + + def _set_path_srlgs_names(self, v, load=False): + """ + Setter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_names() directly. + + YANG Description: Container for the list of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_srlgs_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_names(self): + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_route_objects(self): + """ + Getter method for path_route_objects, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects (container) + + YANG Description: Container for the list of route objects either returned by +the computation engine or actually used by an LSP. + """ + return self.__path_route_objects + + def _set_path_route_objects(self, v, load=False): + """ + Setter method for path_route_objects, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_route_objects is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_route_objects() directly. + + YANG Description: Container for the list of route objects either returned by +the computation engine or actually used by an LSP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_route_objects must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_route_objects = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_route_objects(self): + self.__path_route_objects = YANGDynClass(base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + path_metric = __builtin__.property(_get_path_metric) + path_affinities_values = __builtin__.property(_get_path_affinities_values) + path_affinity_names = __builtin__.property(_get_path_affinity_names) + path_srlgs_lists = __builtin__.property(_get_path_srlgs_lists) + path_srlgs_names = __builtin__.property(_get_path_srlgs_names) + path_route_objects = __builtin__.property(_get_path_route_objects) + + + _pyangbind_elements = OrderedDict([('path_metric', path_metric), ('path_affinities_values', path_affinities_values), ('path_affinity_names', path_affinity_names), ('path_srlgs_lists', path_srlgs_lists), ('path_srlgs_names', path_srlgs_names), ('path_route_objects', path_route_objects), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/__init__.py new file mode 100644 index 000000000..5e54de272 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_affinities_value +class path_affinities_values(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-properties/path-affinities-values. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as values. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinities_value',) + + _yang_name = 'path-affinities-values' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-affinities-values'] + + def _get_path_affinities_value(self): + """ + Getter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinities_value + + def _set_path_affinities_value(self, v, load=False): + """ + Setter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_value() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_value must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_affinities_value = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_value(self): + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_affinities_value = __builtin__.property(_get_path_affinities_value) + + + _pyangbind_elements = OrderedDict([('path_affinities_value', path_affinities_value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value/__init__.py new file mode 100644 index 000000000..df6fd94eb --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value/__init__.py @@ -0,0 +1,161 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_affinities_value(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-properties/path-affinities-values/path-affinities-value. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__value',) + + _yang_name = 'path-affinities-value' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-affinities-values', 'path-affinities-value'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value/usage (identityref) + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_value(self): + """ + Getter method for value, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value/value (admin-groups) + + YANG Description: The affinity value. The default is empty. + """ + return self.__value + + def _set_value(self, v, load=False): + """ + Setter method for value, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value/value (admin-groups) + If this variable is read-only (config: false) in the + source YANG file, then _set_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_value() directly. + + YANG Description: The affinity value. The default is empty. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """value must be of a type compatible with admin-groups""", + 'defined-type': "ietf-te-topology:admin-groups", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False)""", + }) + + self.__value = t + if hasattr(self, '_set'): + self._set() + + def _unset_value(self): + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False) + + usage = __builtin__.property(_get_usage) + value = __builtin__.property(_get_value) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('value', value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/__init__.py new file mode 100644 index 000000000..97969b437 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_affinity_name +class path_affinity_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-properties/path-affinity-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as names. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinity_name',) + + _yang_name = 'path-affinity-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-affinity-names'] + + def _get_path_affinity_name(self): + """ + Getter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinity_name + + def _set_path_affinity_name(self, v, load=False): + """ + Setter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_name() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_name(self): + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_affinity_name = __builtin__.property(_get_path_affinity_name) + + + _pyangbind_elements = OrderedDict([('path_affinity_name', path_affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/__init__.py new file mode 100644 index 000000000..47b1cb476 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/__init__.py @@ -0,0 +1,162 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import affinity_name +class path_affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-properties/path-affinity-names/path-affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__affinity_name',) + + _yang_name = 'path-affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-affinity-names', 'path-affinity-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/usage (identityref) + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_affinity_name(self): + """ + Getter method for affinity_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/affinity_name (list) + + YANG Description: List of named affinities. + """ + return self.__affinity_name + + def _set_affinity_name(self, v, load=False): + """ + Setter method for affinity_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_affinity_name() directly. + + YANG Description: List of named affinities. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_affinity_name(self): + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + usage = __builtin__.property(_get_usage) + affinity_name = __builtin__.property(_get_affinity_name) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('affinity_name', affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py new file mode 100644 index 000000000..043b7900e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-properties/path-affinity-names/path-affinity-name/affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinities. + """ + __slots__ = ('_path_helper', '_extmethods', '__name',) + + _yang_name = 'affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-affinity-names', 'path-affinity-name', 'affinity-name'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/affinity_name/name (string) + + YANG Description: Identifies a named affinity entry. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/affinity_name/name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: Identifies a named affinity entry. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + name = __builtin__.property(_get_name) + + + _pyangbind_elements = OrderedDict([('name', name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_metric/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_metric/__init__.py new file mode 100644 index 000000000..46350a791 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_metric/__init__.py @@ -0,0 +1,159 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_metric(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-properties/path-metric. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE path metric type. + """ + __slots__ = ('_path_helper', '_extmethods', '__metric_type','__accumulative_value',) + + _yang_name = 'path-metric' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__accumulative_value = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-metric'] + + def _get_metric_type(self): + """ + Getter method for metric_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_metric/metric_type (identityref) + + YANG Description: TE path metric type. + """ + return self.__metric_type + + def _set_metric_type(self, v, load=False): + """ + Setter method for metric_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_metric/metric_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_metric_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_metric_type() directly. + + YANG Description: TE path metric type. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """metric_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__metric_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_metric_type(self): + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_accumulative_value(self): + """ + Getter method for accumulative_value, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_metric/accumulative_value (uint64) + + YANG Description: TE path metric accumulative value. + """ + return self.__accumulative_value + + def _set_accumulative_value(self, v, load=False): + """ + Setter method for accumulative_value, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_metric/accumulative_value (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_accumulative_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_accumulative_value() directly. + + YANG Description: TE path metric accumulative value. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """accumulative_value must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False)""", + }) + + self.__accumulative_value = t + if hasattr(self, '_set'): + self._set() + + def _unset_accumulative_value(self): + self.__accumulative_value = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + + metric_type = __builtin__.property(_get_metric_type) + accumulative_value = __builtin__.property(_get_accumulative_value) + + + _pyangbind_elements = OrderedDict([('metric_type', metric_type), ('accumulative_value', accumulative_value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/__init__.py new file mode 100644 index 000000000..cd515c92f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/__init__.py @@ -0,0 +1,119 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_route_object +class path_route_objects(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-properties/path-route-objects. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of route objects either returned by +the computation engine or actually used by an LSP. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_route_object',) + + _yang_name = 'path-route-objects' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_route_object = YANGDynClass(base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-route-objects'] + + def _get_path_route_object(self): + """ + Getter method for path_route_object, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object (list) + + YANG Description: List of route objects either returned by the computation +engine or actually used by an LSP. + """ + return self.__path_route_object + + def _set_path_route_object(self, v, load=False): + """ + Setter method for path_route_object, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_route_object is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_route_object() directly. + + YANG Description: List of route objects either returned by the computation +engine or actually used by an LSP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_route_object must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_route_object = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_route_object(self): + self.__path_route_object = YANGDynClass(base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_route_object = __builtin__.property(_get_path_route_object) + + + _pyangbind_elements = OrderedDict([('path_route_object', path_route_object), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/__init__.py new file mode 100644 index 000000000..1161f751e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/__init__.py @@ -0,0 +1,327 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class path_route_object(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-properties/path-route-objects/path-route-object. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of route objects either returned by the computation +engine or actually used by an LSP. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'path-route-object' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-route-objects', 'path-route-object'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/index (uint32) + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key +values. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/index (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key +values. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + index = __builtin__.property(_get_index) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop) + label_hop = __builtin__.property(_get_label_hop) + + __choices__ = {'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('index', index), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/as_number_hop/__init__.py new file mode 100644 index 000000000..b257ffed7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-properties/path-route-objects/path-route-object/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-route-objects', 'path-route-object', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + as_number = __builtin__.property(_get_as_number) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/__init__.py new file mode 100644 index 000000000..1740e147e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-properties/path-route-objects/path-route-object/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-route-objects', 'path-route-object', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_label = __builtin__.property(_get_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/__init__.py new file mode 100644 index 000000000..f69cf8311 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-properties/path-route-objects/path-route-object/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-route-objects', 'path-route-object', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + vlanid = __builtin__.property(_get_vlanid) + direction = __builtin__.property(_get_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/__init__.py new file mode 100644 index 000000000..e8b6d2f8d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-properties/path-route-objects/path-route-object/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-route-objects', 'path-route-object', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + + tpn = __builtin__.property(_get_tpn) + tsg = __builtin__.property(_get_tsg) + ts_list = __builtin__.property(_get_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop/__init__.py new file mode 100644 index 000000000..af1242f7d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-properties/path-route-objects/path-route-object/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-route-objects', 'path-route-object', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_node_hop/__init__.py new file mode 100644 index 000000000..6d0602665 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-properties/path-route-objects/path-route-object/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-route-objects', 'path-route-object', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_node_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/__init__.py new file mode 100644 index 000000000..ce5442e68 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-properties/path-route-objects/path-route-object/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-route-objects', 'path-route-object', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/__init__.py new file mode 100644 index 000000000..9eeb9f3bc --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_srlgs_list +class path_srlgs_lists(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-properties/path-srlgs-lists. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path SRLG properties container. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_list',) + + _yang_name = 'path-srlgs-lists' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-srlgs-lists'] + + def _get_path_srlgs_list(self): + """ + Getter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list (list) + + YANG Description: List of SRLG values to be included or excluded. + """ + return self.__path_srlgs_list + + def _set_path_srlgs_list(self, v, load=False): + """ + Setter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_list() directly. + + YANG Description: List of SRLG values to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_list must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_srlgs_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_list(self): + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_srlgs_list = __builtin__.property(_get_path_srlgs_list) + + + _pyangbind_elements = OrderedDict([('path_srlgs_list', path_srlgs_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py new file mode 100644 index 000000000..1055b900a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py @@ -0,0 +1,161 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_srlgs_list(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-properties/path-srlgs-lists/path-srlgs-list. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of SRLG values to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__values',) + + _yang_name = 'path-srlgs-list' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-srlgs-lists', 'path-srlgs-list'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list/usage (identityref) + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_values(self): + """ + Getter method for values, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list/values (srlg) + + YANG Description: List of SRLG values. + """ + return self.__values + + def _set_values(self, v, load=False): + """ + Setter method for values, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list/values (srlg) + If this variable is read-only (config: false) in the + source YANG file, then _set_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_values() directly. + + YANG Description: List of SRLG values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """values must be of a type compatible with srlg""", + 'defined-type': "ietf-te-topology:srlg", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False)""", + }) + + self.__values = t + if hasattr(self, '_set'): + self._set() + + def _unset_values(self): + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False) + + usage = __builtin__.property(_get_usage) + values = __builtin__.property(_get_values) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('values', values), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/__init__.py new file mode 100644 index 000000000..796ccb5f2 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_srlgs_name +class path_srlgs_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-properties/path-srlgs-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of named SRLGs. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_name',) + + _yang_name = 'path-srlgs-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-srlgs-names'] + + def _get_path_srlgs_name(self): + """ + Getter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name (list) + + YANG Description: List of named SRLGs to be included or excluded. + """ + return self.__path_srlgs_name + + def _set_path_srlgs_name(self, v, load=False): + """ + Setter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_name() directly. + + YANG Description: List of named SRLGs to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_srlgs_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_name(self): + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_srlgs_name = __builtin__.property(_get_path_srlgs_name) + + + _pyangbind_elements = OrderedDict([('path_srlgs_name', path_srlgs_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name/__init__.py new file mode 100644 index 000000000..bdfa7bcab --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name/__init__.py @@ -0,0 +1,161 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_srlgs_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/path-properties/path-srlgs-names/path-srlgs-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named SRLGs to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__names',) + + _yang_name = 'path-srlgs-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-srlgs-names', 'path-srlgs-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name/usage (identityref) + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_names(self): + """ + Getter method for names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name/names (string) + + YANG Description: List of named SRLGs. + """ + return self.__names + + def _set_names(self, v, load=False): + """ + Setter method for names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name/names (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_names() directly. + + YANG Description: List of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """names must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__names = t + if hasattr(self, '_set'): + self._set() + + def _unset_names(self): + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + usage = __builtin__.property(_get_usage) + names = __builtin__.property(_get_names) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('names', names), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/__init__.py new file mode 100644 index 000000000..71191caa0 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/__init__.py @@ -0,0 +1,155 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import label_restrictions +class to(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/to. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Reference to a destination LTP. + """ + __slots__ = ('_path_helper', '_extmethods', '__tp_ref','__label_restrictions',) + + _yang_name = 'to' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tp_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + self.__label_restrictions = YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'to'] + + def _get_tp_ref(self): + """ + Getter method for tp_ref, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/tp_ref (leafref) + + YANG Description: Relative reference to a termination point. + """ + return self.__tp_ref + + def _set_tp_ref(self, v, load=False): + """ + Setter method for tp_ref, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/tp_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tp_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tp_ref() directly. + + YANG Description: Relative reference to a termination point. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tp_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False)""", + }) + + self.__tp_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_tp_ref(self): + self.__tp_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + + + def _get_label_restrictions(self): + """ + Getter method for label_restrictions, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions (container) + + YANG Description: The label restrictions container. + """ + return self.__label_restrictions + + def _set_label_restrictions(self, v, load=False): + """ + Setter method for label_restrictions, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_restrictions is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_restrictions() directly. + + YANG Description: The label restrictions container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_restrictions must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_restrictions = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_restrictions(self): + self.__label_restrictions = YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + tp_ref = __builtin__.property(_get_tp_ref) + label_restrictions = __builtin__.property(_get_label_restrictions) + + + _pyangbind_elements = OrderedDict([('tp_ref', tp_ref), ('label_restrictions', label_restrictions), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/__init__.py new file mode 100644 index 000000000..3873a02ce --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/__init__.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import label_restriction +class label_restrictions(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/to/label-restrictions. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The label restrictions container. + """ + __slots__ = ('_path_helper', '_extmethods', '__label_restriction',) + + _yang_name = 'label-restrictions' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__label_restriction = YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions'] + + def _get_label_restriction(self): + """ + Getter method for label_restriction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction (list) + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + return self.__label_restriction + + def _set_label_restriction(self, v, load=False): + """ + Setter method for label_restriction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_restriction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_restriction() directly. + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_restriction must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__label_restriction = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_restriction(self): + self.__label_restriction = YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + label_restriction = __builtin__.property(_get_label_restriction) + + + _pyangbind_elements = OrderedDict([('label_restriction', label_restriction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/__init__.py new file mode 100644 index 000000000..dbf240ba8 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/__init__.py @@ -0,0 +1,450 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import label_start +from . import label_end +from . import label_step +from . import otn_label_range +from . import ethernet_label_range +class label_restriction(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/to/label-restrictions/label-restriction. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + __slots__ = ('_path_helper', '_extmethods', '__restriction','__index','__label_start','__label_end','__label_step','__range_bitmap','__otn_label_range','__ethernet_label_range',) + + _yang_name = 'label-restriction' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__restriction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=False) + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__label_start = YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__label_end = YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__label_step = YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__range_bitmap = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=False) + self.__otn_label_range = YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__ethernet_label_range = YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions', 'label-restriction'] + + def _get_restriction(self): + """ + Getter method for restriction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/restriction (enumeration) + + YANG Description: Indicates whether the list item is inclusive or exclusive. + """ + return self.__restriction + + def _set_restriction(self, v, load=False): + """ + Setter method for restriction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/restriction (enumeration) + If this variable is read-only (config: false) in the + source YANG file, then _set_restriction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_restriction() directly. + + YANG Description: Indicates whether the list item is inclusive or exclusive. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """restriction must be of a type compatible with enumeration""", + 'defined-type': "ietf-te-topology:enumeration", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=False)""", + }) + + self.__restriction = t + if hasattr(self, '_set'): + self._set() + + def _unset_restriction(self): + self.__restriction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=False) + + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/index (uint32) + + YANG Description: The index of the label restriction list entry. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/index (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: The index of the label restriction list entry. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_label_start(self): + """ + Getter method for label_start, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start (container) + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + return self.__label_start + + def _set_label_start(self, v, load=False): + """ + Setter method for label_start, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_start is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_start() directly. + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_start must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_start = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_start(self): + self.__label_start = YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_label_end(self): + """ + Getter method for label_end, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end (container) + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + return self.__label_end + + def _set_label_end(self, v, load=False): + """ + Setter method for label_end, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_end is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_end() directly. + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_end must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_end = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_end(self): + self.__label_end = YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_label_step(self): + """ + Getter method for label_step, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step (container) + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + return self.__label_step + + def _set_label_step(self, v, load=False): + """ + Setter method for label_step, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_step is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_step() directly. + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_step must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_step = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_step(self): + self.__label_step = YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_range_bitmap(self): + """ + Getter method for range_bitmap, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/range_bitmap (yang:hex-string) + + YANG Description: When there are gaps between 'label-start' and 'label-end', +this attribute is used to specify the positions +of the used labels. This is represented in big endian as +'hex-string'. +The most significant byte in the hex-string is the farthest +to the left in the byte sequence. Leading zero bytes in the +configured value may be omitted for brevity. +Each bit position in the 'range-bitmap' 'hex-string' maps +to a label in the range derived from 'label-start'. + +For example, assuming that 'label-start' = 16000 and +'range-bitmap' = 0x01000001, then: + +- bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. +- bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1. + """ + return self.__range_bitmap + + def _set_range_bitmap(self, v, load=False): + """ + Setter method for range_bitmap, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/range_bitmap (yang:hex-string) + If this variable is read-only (config: false) in the + source YANG file, then _set_range_bitmap is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_range_bitmap() directly. + + YANG Description: When there are gaps between 'label-start' and 'label-end', +this attribute is used to specify the positions +of the used labels. This is represented in big endian as +'hex-string'. +The most significant byte in the hex-string is the farthest +to the left in the byte sequence. Leading zero bytes in the +configured value may be omitted for brevity. +Each bit position in the 'range-bitmap' 'hex-string' maps +to a label in the range derived from 'label-start'. + +For example, assuming that 'label-start' = 16000 and +'range-bitmap' = 0x01000001, then: + +- bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. +- bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """range_bitmap must be of a type compatible with yang:hex-string""", + 'defined-type': "yang:hex-string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=False)""", + }) + + self.__range_bitmap = t + if hasattr(self, '_set'): + self._set() + + def _unset_range_bitmap(self): + self.__range_bitmap = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=False) + + + def _get_otn_label_range(self): + """ + Getter method for otn_label_range, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range (container) + + YANG Description: Label range information for OTN. + """ + return self.__otn_label_range + + def _set_otn_label_range(self, v, load=False): + """ + Setter method for otn_label_range, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn_label_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn_label_range() directly. + + YANG Description: Label range information for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn_label_range must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn_label_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn_label_range(self): + self.__otn_label_range = YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_ethernet_label_range(self): + """ + Getter method for ethernet_label_range, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/ethernet_label_range (container) + + YANG Description: Ethernet-specific label range related information. + """ + return self.__ethernet_label_range + + def _set_ethernet_label_range(self, v, load=False): + """ + Setter method for ethernet_label_range, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/ethernet_label_range (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_ethernet_label_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ethernet_label_range() directly. + + YANG Description: Ethernet-specific label range related information. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ethernet_label_range must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=False)""", + }) + + self.__ethernet_label_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_ethernet_label_range(self): + self.__ethernet_label_range = YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=False) + + restriction = __builtin__.property(_get_restriction) + index = __builtin__.property(_get_index) + label_start = __builtin__.property(_get_label_start) + label_end = __builtin__.property(_get_label_end) + label_step = __builtin__.property(_get_label_step) + range_bitmap = __builtin__.property(_get_range_bitmap) + otn_label_range = __builtin__.property(_get_otn_label_range) + ethernet_label_range = __builtin__.property(_get_ethernet_label_range) + + + _pyangbind_elements = OrderedDict([('restriction', restriction), ('index', index), ('label_start', label_start), ('label_end', label_end), ('label_step', label_step), ('range_bitmap', range_bitmap), ('otn_label_range', otn_label_range), ('ethernet_label_range', ethernet_label_range), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/ethernet_label_range/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/ethernet_label_range/__init__.py new file mode 100644 index 000000000..3f672822b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/ethernet_label_range/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class ethernet_label_range(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/to/label-restrictions/label-restriction/ethernet-label-range. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Ethernet-specific label range related information. + """ + __slots__ = ('_path_helper', '_extmethods', '__tag_type','__priority',) + + _yang_name = 'ethernet-label-range' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tag_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=False) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions', 'label-restriction', 'ethernet-label-range'] + + def _get_tag_type(self): + """ + Getter method for tag_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/ethernet_label_range/tag_type (etht-types:eth-tag-type) + + YANG Description: VLAN tag type. + """ + return self.__tag_type + + def _set_tag_type(self, v, load=False): + """ + Setter method for tag_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/ethernet_label_range/tag_type (etht-types:eth-tag-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_tag_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tag_type() directly. + + YANG Description: VLAN tag type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tag_type must be of a type compatible with etht-types:eth-tag-type""", + 'defined-type': "etht-types:eth-tag-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=False)""", + }) + + self.__tag_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_tag_type(self): + self.__tag_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=False) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/ethernet_label_range/priority (uint8) + + YANG Description: priority. + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/ethernet_label_range/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: priority. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=False)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=False) + + tag_type = __builtin__.property(_get_tag_type) + priority = __builtin__.property(_get_priority) + + + _pyangbind_elements = OrderedDict([('tag_type', tag_type), ('priority', priority), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/__init__.py new file mode 100644 index 000000000..332a60265 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/__init__.py @@ -0,0 +1,119 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_end(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/to/label-restrictions/label-restriction/label-end. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-end' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions', 'label-restriction', 'label-end'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_label = __builtin__.property(_get_te_label) + + + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/__init__.py new file mode 100644 index 000000000..37028d9bf --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/to/label-restrictions/label-restriction/label-end/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions', 'label-restriction', 'label-end', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/otn (container) + + YANG Description: Label start or label end for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label start or label end for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + vlanid = __builtin__.property(_get_vlanid) + direction = __builtin__.property(_get_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py new file mode 100644 index 000000000..162b89624 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/to/label-restrictions/label-restriction/label-end/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label start or label end for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions', 'label-restriction', 'label-end', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/otn/ts (otn-ts) + + YANG Description: Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + + tpn = __builtin__.property(_get_tpn) + ts = __builtin__.property(_get_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/__init__.py new file mode 100644 index 000000000..334475e0d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/__init__.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_start(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/to/label-restrictions/label-restriction/label-start. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-start' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions', 'label-restriction', 'label-start'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_label = __builtin__.property(_get_te_label) + + + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/__init__.py new file mode 100644 index 000000000..7c384d8f7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/to/label-restrictions/label-restriction/label-start/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions', 'label-restriction', 'label-start', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/otn (container) + + YANG Description: Label start or label end for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label start or label end for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + vlanid = __builtin__.property(_get_vlanid) + direction = __builtin__.property(_get_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py new file mode 100644 index 000000000..612e7141b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/to/label-restrictions/label-restriction/label-start/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label start or label end for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions', 'label-restriction', 'label-start', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/otn/ts (otn-ts) + + YANG Description: Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + + tpn = __builtin__.property(_get_tpn) + ts = __builtin__.property(_get_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/__init__.py new file mode 100644 index 000000000..12f872b1f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/__init__.py @@ -0,0 +1,200 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class label_step(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/to/label-restrictions/label-restriction/label-step. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_step',) + + _yang_name = 'label-step' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__eth_step = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions', 'label-restriction', 'label-step'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/generic (int32) + + YANG Description: Label range step. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/generic (int32) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Label range step. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with int32""", + 'defined-type': "int32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/otn (container) + + YANG Description: Label step for OTN + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label step for OTN + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_eth_step(self): + """ + Getter method for eth_step, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/eth_step (uint16) + + YANG Description: Label step which represent possible increments for +an Ethernet VLAN tag. + """ + return self.__eth_step + + def _set_eth_step(self, v, load=False): + """ + Setter method for eth_step, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/eth_step (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_step is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_step() directly. + + YANG Description: Label step which represent possible increments for +an Ethernet VLAN tag. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_step must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=False)""", + }) + + self.__eth_step = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_step(self): + self.__eth_step = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + eth_step = __builtin__.property(_get_eth_step) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['eth_step']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_step', eth_step), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/otn/__init__.py new file mode 100644 index 000000000..4f53bda83 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/otn/__init__.py @@ -0,0 +1,158 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/to/label-restrictions/label-restriction/label-step/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label step for OTN + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions', 'label-restriction', 'label-step', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/otn/tpn (otn-tpn) + + YANG Description: Label step which represents possible increments for +Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Label step which represents possible increments for +Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/otn/ts (otn-ts) + + YANG Description: Label step which represents possible increments for +Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Label step which represents possible increments for +Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + + tpn = __builtin__.property(_get_tpn) + ts = __builtin__.property(_get_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/__init__.py new file mode 100644 index 000000000..84ed14bf9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/__init__.py @@ -0,0 +1,256 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn_label_range(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/to/label-restrictions/label-restriction/otn-label-range. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label range information for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__range_type','__tsg','__odu_type_list','__priority',) + + _yang_name = 'otn-label-range' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__range_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=False) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__odu_type_list = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions', 'label-restriction', 'otn-label-range'] + + def _get_range_type(self): + """ + Getter method for range_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/range_type (otn-label-range-type) + + YANG Description: The type of range (e.g., TPN or TS) +to which the label range applies + """ + return self.__range_type + + def _set_range_type(self, v, load=False): + """ + Setter method for range_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/range_type (otn-label-range-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_range_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_range_type() directly. + + YANG Description: The type of range (e.g., TPN or TS) +to which the label range applies + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """range_type must be of a type compatible with otn-label-range-type""", + 'defined-type': "ietf-otn-topology:otn-label-range-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=False)""", + }) + + self.__range_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_range_type(self): + self.__range_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=False) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/tsg (identityref) + + YANG Description: Tributary slot granularity (TSG) to which the label range +applies. + +This leaf MUST be present when the range-type is TS. + +This leaf MAY be omitted when mapping an ODUk over an OTUk +Link. In this case the range-type is tpn, with only one +entry (ODUk), and the tpn range has only one value (1). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary slot granularity (TSG) to which the label range +applies. + +This leaf MUST be present when the range-type is TS. + +This leaf MAY be omitted when mapping an ODUk over an OTUk +Link. In this case the range-type is tpn, with only one +entry (ODUk), and the tpn range has only one value (1). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_odu_type_list(self): + """ + Getter method for odu_type_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/odu_type_list (identityref) + + YANG Description: List of ODU types to which the label range applies. + +An Empty odu-type-list means that the label range +applies to all the supported ODU types. + """ + return self.__odu_type_list + + def _set_odu_type_list(self, v, load=False): + """ + Setter method for odu_type_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/odu_type_list (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type_list() directly. + + YANG Description: List of ODU types to which the label range applies. + +An Empty odu-type-list means that the label range +applies to all the supported ODU types. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type_list must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__odu_type_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type_list(self): + self.__odu_type_list = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/priority (uint8) + + YANG Description: Priority in Interface Switching Capability +Descriptor (ISCD). + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: Priority in Interface Switching Capability +Descriptor (ISCD). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=False)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=False) + + range_type = __builtin__.property(_get_range_type) + tsg = __builtin__.property(_get_tsg) + odu_type_list = __builtin__.property(_get_odu_type_list) + priority = __builtin__.property(_get_priority) + + + _pyangbind_elements = OrderedDict([('range_type', range_type), ('tsg', tsg), ('odu_type_list', odu_type_list), ('priority', priority), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/__init__.py new file mode 100644 index 000000000..0660881e2 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/__init__.py @@ -0,0 +1,326 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import primary_path +from . import backup_path +from . import tunnel_termination_points +from . import tunnels +class underlay(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/underlay. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Attributes of the TE link underlay. + """ + __slots__ = ('_path_helper', '_extmethods', '__enabled','__primary_path','__backup_path','__protection_type','__tunnel_termination_points','__tunnels',) + + _yang_name = 'underlay' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__enabled = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + self.__primary_path = YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__backup_path = YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + self.__protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__tunnel_termination_points = YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__tunnels = YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'underlay'] + + def _get_enabled(self): + """ + Getter method for enabled, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/enabled (boolean) + + YANG Description: 'true' if the underlay is enabled. +'false' if the underlay is disabled. + """ + return self.__enabled + + def _set_enabled(self, v, load=False): + """ + Setter method for enabled, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/enabled (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_enabled is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_enabled() directly. + + YANG Description: 'true' if the underlay is enabled. +'false' if the underlay is disabled. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """enabled must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False)""", + }) + + self.__enabled = t + if hasattr(self, '_set'): + self._set() + + def _unset_enabled(self): + self.__enabled = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + + + def _get_primary_path(self): + """ + Getter method for primary_path, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path (container) + + YANG Description: The service path on the underlay topology that +supports this link. + """ + return self.__primary_path + + def _set_primary_path(self, v, load=False): + """ + Setter method for primary_path, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_primary_path is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_primary_path() directly. + + YANG Description: The service path on the underlay topology that +supports this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """primary_path must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__primary_path = t + if hasattr(self, '_set'): + self._set() + + def _unset_primary_path(self): + self.__primary_path = YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_backup_path(self): + """ + Getter method for backup_path, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path (list) + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + return self.__backup_path + + def _set_backup_path(self, v, load=False): + """ + Setter method for backup_path, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_backup_path is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_backup_path() directly. + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """backup_path must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__backup_path = t + if hasattr(self, '_set'): + self._set() + + def _unset_backup_path(self): + self.__backup_path = YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + + def _get_protection_type(self): + """ + Getter method for protection_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/protection_type (identityref) + + YANG Description: Underlay protection type desired for this link. + """ + return self.__protection_type + + def _set_protection_type(self, v, load=False): + """ + Setter method for protection_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/protection_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_protection_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_protection_type() directly. + + YANG Description: Underlay protection type desired for this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """protection_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__protection_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_protection_type(self): + self.__protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_tunnel_termination_points(self): + """ + Getter method for tunnel_termination_points, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points (container) + + YANG Description: Underlay TTPs desired for this link. + """ + return self.__tunnel_termination_points + + def _set_tunnel_termination_points(self, v, load=False): + """ + Setter method for tunnel_termination_points, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel_termination_points is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel_termination_points() directly. + + YANG Description: Underlay TTPs desired for this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel_termination_points must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__tunnel_termination_points = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel_termination_points(self): + self.__tunnel_termination_points = YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_tunnels(self): + """ + Getter method for tunnels, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnels (container) + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + return self.__tunnels + + def _set_tunnels(self, v, load=False): + """ + Setter method for tunnels, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnels (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnels is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnels() directly. + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnels must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__tunnels = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnels(self): + self.__tunnels = YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + enabled = __builtin__.property(_get_enabled) + primary_path = __builtin__.property(_get_primary_path) + backup_path = __builtin__.property(_get_backup_path) + protection_type = __builtin__.property(_get_protection_type) + tunnel_termination_points = __builtin__.property(_get_tunnel_termination_points) + tunnels = __builtin__.property(_get_tunnels) + + + _pyangbind_elements = OrderedDict([('enabled', enabled), ('primary_path', primary_path), ('backup_path', backup_path), ('protection_type', protection_type), ('tunnel_termination_points', tunnel_termination_points), ('tunnels', tunnels), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/__init__.py new file mode 100644 index 000000000..5e6da0327 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/__init__.py @@ -0,0 +1,207 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_element +class backup_path(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/underlay/backup-path. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__network_ref','__path_element',) + + _yang_name = 'backup-path' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'backup-path'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/index (uint32) + + YANG Description: A sequence number to identify a backup path. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/index (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: A sequence number to identify a backup path. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + + + def _get_path_element(self): + """ + Getter method for path_element, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element (list) + + YANG Description: A list of path elements describing the backup service +path. + """ + return self.__path_element + + def _set_path_element(self, v, load=False): + """ + Setter method for path_element, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element() directly. + + YANG Description: A list of path elements describing the backup service +path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_element = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element(self): + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + index = __builtin__.property(_get_index) + network_ref = __builtin__.property(_get_network_ref) + path_element = __builtin__.property(_get_path_element) + + + _pyangbind_elements = OrderedDict([('index', index), ('network_ref', network_ref), ('path_element', path_element), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/__init__.py new file mode 100644 index 000000000..0e6bea889 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/__init__.py @@ -0,0 +1,321 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class path_element(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/underlay/backup-path/path-element. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of path elements describing the backup service +path. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_element_id','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'path-element' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'backup-path', 'path-element'] + + def _get_path_element_id(self): + """ + Getter method for path_element_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/path_element_id (uint32) + + YANG Description: To identify the element in a path. + """ + return self.__path_element_id + + def _set_path_element_id(self, v, load=False): + """ + Setter method for path_element_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/path_element_id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element_id() directly. + + YANG Description: To identify the element in a path. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element_id must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False)""", + }) + + self.__path_element_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element_id(self): + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + path_element_id = __builtin__.property(_get_path_element_id) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop) + label_hop = __builtin__.property(_get_label_hop) + + __choices__ = {'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('path_element_id', path_element_id), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/as_number_hop/__init__.py new file mode 100644 index 000000000..2245d0d0e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/underlay/backup-path/path-element/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'backup-path', 'path-element', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + as_number = __builtin__.property(_get_as_number) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/__init__.py new file mode 100644 index 000000000..9fc0b539a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/underlay/backup-path/path-element/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'backup-path', 'path-element', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_label = __builtin__.property(_get_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/__init__.py new file mode 100644 index 000000000..6ed428029 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/underlay/backup-path/path-element/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'backup-path', 'path-element', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + vlanid = __builtin__.property(_get_vlanid) + direction = __builtin__.property(_get_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py new file mode 100644 index 000000000..242d6f3f2 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/underlay/backup-path/path-element/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'backup-path', 'path-element', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + + tpn = __builtin__.property(_get_tpn) + tsg = __builtin__.property(_get_tsg) + ts_list = __builtin__.property(_get_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop/__init__.py new file mode 100644 index 000000000..f6c47d464 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/underlay/backup-path/path-element/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'backup-path', 'path-element', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_node_hop/__init__.py new file mode 100644 index 000000000..ba3dfc1f6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/underlay/backup-path/path-element/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'backup-path', 'path-element', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_node_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py new file mode 100644 index 000000000..b5d313c9b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/underlay/backup-path/path-element/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'backup-path', 'path-element', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/__init__.py new file mode 100644 index 000000000..9efabfdc9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/__init__.py @@ -0,0 +1,158 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_element +class primary_path(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/underlay/primary-path. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The service path on the underlay topology that +supports this link. + """ + __slots__ = ('_path_helper', '_extmethods', '__network_ref','__path_element',) + + _yang_name = 'primary-path' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'primary-path'] + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + + + def _get_path_element(self): + """ + Getter method for path_element, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element (list) + + YANG Description: A list of path elements describing the service path. + """ + return self.__path_element + + def _set_path_element(self, v, load=False): + """ + Setter method for path_element, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element() directly. + + YANG Description: A list of path elements describing the service path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_element = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element(self): + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + network_ref = __builtin__.property(_get_network_ref) + path_element = __builtin__.property(_get_path_element) + + + _pyangbind_elements = OrderedDict([('network_ref', network_ref), ('path_element', path_element), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/__init__.py new file mode 100644 index 000000000..c680af6e0 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/__init__.py @@ -0,0 +1,320 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class path_element(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/underlay/primary-path/path-element. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of path elements describing the service path. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_element_id','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'path-element' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'primary-path', 'path-element'] + + def _get_path_element_id(self): + """ + Getter method for path_element_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/path_element_id (uint32) + + YANG Description: To identify the element in a path. + """ + return self.__path_element_id + + def _set_path_element_id(self, v, load=False): + """ + Setter method for path_element_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/path_element_id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element_id() directly. + + YANG Description: To identify the element in a path. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element_id must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False)""", + }) + + self.__path_element_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element_id(self): + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + path_element_id = __builtin__.property(_get_path_element_id) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop) + label_hop = __builtin__.property(_get_label_hop) + + __choices__ = {'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('path_element_id', path_element_id), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/as_number_hop/__init__.py new file mode 100644 index 000000000..33f85e528 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/underlay/primary-path/path-element/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'primary-path', 'path-element', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + as_number = __builtin__.property(_get_as_number) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/__init__.py new file mode 100644 index 000000000..6cb0c9c11 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/underlay/primary-path/path-element/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'primary-path', 'path-element', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_label = __builtin__.property(_get_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/__init__.py new file mode 100644 index 000000000..04bb5f8c6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/underlay/primary-path/path-element/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'primary-path', 'path-element', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + vlanid = __builtin__.property(_get_vlanid) + direction = __builtin__.property(_get_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py new file mode 100644 index 000000000..e0b0c85c5 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/underlay/primary-path/path-element/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'primary-path', 'path-element', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + + tpn = __builtin__.property(_get_tpn) + tsg = __builtin__.property(_get_tsg) + ts_list = __builtin__.property(_get_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop/__init__.py new file mode 100644 index 000000000..bc4a1ad28 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/underlay/primary-path/path-element/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'primary-path', 'path-element', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_node_hop/__init__.py new file mode 100644 index 000000000..1f6120bd5 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/underlay/primary-path/path-element/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'primary-path', 'path-element', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_node_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py new file mode 100644 index 000000000..7f75c0107 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/underlay/primary-path/path-element/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'primary-path', 'path-element', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points/__init__.py new file mode 100644 index 000000000..fe1f4b855 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class tunnel_termination_points(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/underlay/tunnel-termination-points. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Underlay TTPs desired for this link. + """ + __slots__ = ('_path_helper', '_extmethods', '__source','__destination',) + + _yang_name = 'tunnel-termination-points' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__source = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=False) + self.__destination = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'tunnel-termination-points'] + + def _get_source(self): + """ + Getter method for source, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points/source (binary) + + YANG Description: Source TTP identifier. + """ + return self.__source + + def _set_source(self, v, load=False): + """ + Setter method for source, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points/source (binary) + If this variable is read-only (config: false) in the + source YANG file, then _set_source is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_source() directly. + + YANG Description: Source TTP identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """source must be of a type compatible with binary""", + 'defined-type': "binary", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=False)""", + }) + + self.__source = t + if hasattr(self, '_set'): + self._set() + + def _unset_source(self): + self.__source = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=False) + + + def _get_destination(self): + """ + Getter method for destination, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points/destination (binary) + + YANG Description: Destination TTP identifier. + """ + return self.__destination + + def _set_destination(self, v, load=False): + """ + Setter method for destination, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points/destination (binary) + If this variable is read-only (config: false) in the + source YANG file, then _set_destination is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_destination() directly. + + YANG Description: Destination TTP identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """destination must be of a type compatible with binary""", + 'defined-type': "binary", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=False)""", + }) + + self.__destination = t + if hasattr(self, '_set'): + self._set() + + def _unset_destination(self): + self.__destination = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=False) + + source = __builtin__.property(_get_source) + destination = __builtin__.property(_get_destination) + + + _pyangbind_elements = OrderedDict([('source', source), ('destination', destination), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnels/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnels/__init__.py new file mode 100644 index 000000000..0493843c7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnels/__init__.py @@ -0,0 +1,167 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import tunnel +class tunnels(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/underlay/tunnels. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + __slots__ = ('_path_helper', '_extmethods', '__sharing','__tunnel',) + + _yang_name = 'tunnels' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__sharing = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + self.__tunnel = YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'tunnels'] + + def _get_sharing(self): + """ + Getter method for sharing, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnels/sharing (boolean) + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. +This leaf is the default option for all TE tunnels +and may be overridden by the per-TE-tunnel value. + """ + return self.__sharing + + def _set_sharing(self, v, load=False): + """ + Setter method for sharing, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnels/sharing (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_sharing is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_sharing() directly. + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. +This leaf is the default option for all TE tunnels +and may be overridden by the per-TE-tunnel value. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """sharing must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False)""", + }) + + self.__sharing = t + if hasattr(self, '_set'): + self._set() + + def _unset_sharing(self): + self.__sharing = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + + + def _get_tunnel(self): + """ + Getter method for tunnel, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel (list) + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + return self.__tunnel + + def _set_tunnel(self, v, load=False): + """ + Setter method for tunnel, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel() directly. + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__tunnel = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel(self): + self.__tunnel = YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + sharing = __builtin__.property(_get_sharing) + tunnel = __builtin__.property(_get_tunnel) + + + _pyangbind_elements = OrderedDict([('sharing', sharing), ('tunnel', tunnel), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel/__init__.py new file mode 100644 index 000000000..0bade4537 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel/__init__.py @@ -0,0 +1,170 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class tunnel(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/connectivity-matrix/underlay/tunnels/tunnel. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + __slots__ = ('_path_helper', '_extmethods', '__tunnel_name','__sharing',) + + _yang_name = 'tunnel' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tunnel_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + self.__sharing = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'tunnels', 'tunnel'] + + def _get_tunnel_name(self): + """ + Getter method for tunnel_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel/tunnel_name (string) + + YANG Description: A tunnel name uniquely identifies an underlay TE tunnel, +used together with the 'source-node' value for this +link. + """ + return self.__tunnel_name + + def _set_tunnel_name(self, v, load=False): + """ + Setter method for tunnel_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel/tunnel_name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel_name() directly. + + YANG Description: A tunnel name uniquely identifies an underlay TE tunnel, +used together with the 'source-node' value for this +link. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel_name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__tunnel_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel_name(self): + self.__tunnel_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + + def _get_sharing(self): + """ + Getter method for sharing, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel/sharing (boolean) + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. + """ + return self.__sharing + + def _set_sharing(self, v, load=False): + """ + Setter method for sharing, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel/sharing (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_sharing is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_sharing() directly. + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """sharing must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False)""", + }) + + self.__sharing = t + if hasattr(self, '_set'): + self._set() + + def _unset_sharing(self): + self.__sharing = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + + tunnel_name = __builtin__.property(_get_tunnel_name) + sharing = __builtin__.property(_get_sharing) + + + _pyangbind_elements = OrderedDict([('tunnel_name', tunnel_name), ('sharing', sharing), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/__init__.py new file mode 100644 index 000000000..6d7414731 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/__init__.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import label_restriction +class label_restrictions(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/label-restrictions. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The label restrictions container. + """ + __slots__ = ('_path_helper', '_extmethods', '__label_restriction',) + + _yang_name = 'label-restrictions' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__label_restriction = YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'label-restrictions'] + + def _get_label_restriction(self): + """ + Getter method for label_restriction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction (list) + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + return self.__label_restriction + + def _set_label_restriction(self, v, load=False): + """ + Setter method for label_restriction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_restriction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_restriction() directly. + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_restriction must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__label_restriction = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_restriction(self): + self.__label_restriction = YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + label_restriction = __builtin__.property(_get_label_restriction) + + + _pyangbind_elements = OrderedDict([('label_restriction', label_restriction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/__init__.py new file mode 100644 index 000000000..39cb5bdab --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/__init__.py @@ -0,0 +1,450 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import label_start +from . import label_end +from . import label_step +from . import otn_label_range +from . import ethernet_label_range +class label_restriction(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/label-restrictions/label-restriction. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + __slots__ = ('_path_helper', '_extmethods', '__restriction','__index','__label_start','__label_end','__label_step','__range_bitmap','__otn_label_range','__ethernet_label_range',) + + _yang_name = 'label-restriction' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__restriction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=False) + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__label_start = YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__label_end = YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__label_step = YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__range_bitmap = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=False) + self.__otn_label_range = YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__ethernet_label_range = YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'label-restrictions', 'label-restriction'] + + def _get_restriction(self): + """ + Getter method for restriction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/restriction (enumeration) + + YANG Description: Indicates whether the list item is inclusive or exclusive. + """ + return self.__restriction + + def _set_restriction(self, v, load=False): + """ + Setter method for restriction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/restriction (enumeration) + If this variable is read-only (config: false) in the + source YANG file, then _set_restriction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_restriction() directly. + + YANG Description: Indicates whether the list item is inclusive or exclusive. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """restriction must be of a type compatible with enumeration""", + 'defined-type': "ietf-te-topology:enumeration", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=False)""", + }) + + self.__restriction = t + if hasattr(self, '_set'): + self._set() + + def _unset_restriction(self): + self.__restriction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=False) + + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/index (uint32) + + YANG Description: The index of the label restriction list entry. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/index (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: The index of the label restriction list entry. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_label_start(self): + """ + Getter method for label_start, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start (container) + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + return self.__label_start + + def _set_label_start(self, v, load=False): + """ + Setter method for label_start, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_start is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_start() directly. + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_start must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_start = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_start(self): + self.__label_start = YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_label_end(self): + """ + Getter method for label_end, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end (container) + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + return self.__label_end + + def _set_label_end(self, v, load=False): + """ + Setter method for label_end, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_end is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_end() directly. + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_end must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_end = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_end(self): + self.__label_end = YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_label_step(self): + """ + Getter method for label_step, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step (container) + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + return self.__label_step + + def _set_label_step(self, v, load=False): + """ + Setter method for label_step, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_step is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_step() directly. + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_step must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_step = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_step(self): + self.__label_step = YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_range_bitmap(self): + """ + Getter method for range_bitmap, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/range_bitmap (yang:hex-string) + + YANG Description: When there are gaps between 'label-start' and 'label-end', +this attribute is used to specify the positions +of the used labels. This is represented in big endian as +'hex-string'. +The most significant byte in the hex-string is the farthest +to the left in the byte sequence. Leading zero bytes in the +configured value may be omitted for brevity. +Each bit position in the 'range-bitmap' 'hex-string' maps +to a label in the range derived from 'label-start'. + +For example, assuming that 'label-start' = 16000 and +'range-bitmap' = 0x01000001, then: + +- bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. +- bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1. + """ + return self.__range_bitmap + + def _set_range_bitmap(self, v, load=False): + """ + Setter method for range_bitmap, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/range_bitmap (yang:hex-string) + If this variable is read-only (config: false) in the + source YANG file, then _set_range_bitmap is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_range_bitmap() directly. + + YANG Description: When there are gaps between 'label-start' and 'label-end', +this attribute is used to specify the positions +of the used labels. This is represented in big endian as +'hex-string'. +The most significant byte in the hex-string is the farthest +to the left in the byte sequence. Leading zero bytes in the +configured value may be omitted for brevity. +Each bit position in the 'range-bitmap' 'hex-string' maps +to a label in the range derived from 'label-start'. + +For example, assuming that 'label-start' = 16000 and +'range-bitmap' = 0x01000001, then: + +- bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. +- bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """range_bitmap must be of a type compatible with yang:hex-string""", + 'defined-type': "yang:hex-string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=False)""", + }) + + self.__range_bitmap = t + if hasattr(self, '_set'): + self._set() + + def _unset_range_bitmap(self): + self.__range_bitmap = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=False) + + + def _get_otn_label_range(self): + """ + Getter method for otn_label_range, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/otn_label_range (container) + + YANG Description: Label range information for OTN. + """ + return self.__otn_label_range + + def _set_otn_label_range(self, v, load=False): + """ + Setter method for otn_label_range, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/otn_label_range (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn_label_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn_label_range() directly. + + YANG Description: Label range information for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn_label_range must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn_label_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn_label_range(self): + self.__otn_label_range = YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_ethernet_label_range(self): + """ + Getter method for ethernet_label_range, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/ethernet_label_range (container) + + YANG Description: Ethernet-specific label range related information. + """ + return self.__ethernet_label_range + + def _set_ethernet_label_range(self, v, load=False): + """ + Setter method for ethernet_label_range, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/ethernet_label_range (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_ethernet_label_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ethernet_label_range() directly. + + YANG Description: Ethernet-specific label range related information. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ethernet_label_range must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=False)""", + }) + + self.__ethernet_label_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_ethernet_label_range(self): + self.__ethernet_label_range = YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=False) + + restriction = __builtin__.property(_get_restriction) + index = __builtin__.property(_get_index) + label_start = __builtin__.property(_get_label_start) + label_end = __builtin__.property(_get_label_end) + label_step = __builtin__.property(_get_label_step) + range_bitmap = __builtin__.property(_get_range_bitmap) + otn_label_range = __builtin__.property(_get_otn_label_range) + ethernet_label_range = __builtin__.property(_get_ethernet_label_range) + + + _pyangbind_elements = OrderedDict([('restriction', restriction), ('index', index), ('label_start', label_start), ('label_end', label_end), ('label_step', label_step), ('range_bitmap', range_bitmap), ('otn_label_range', otn_label_range), ('ethernet_label_range', ethernet_label_range), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/ethernet_label_range/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/ethernet_label_range/__init__.py new file mode 100644 index 000000000..5cfb573c3 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/ethernet_label_range/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class ethernet_label_range(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/label-restrictions/label-restriction/ethernet-label-range. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Ethernet-specific label range related information. + """ + __slots__ = ('_path_helper', '_extmethods', '__tag_type','__priority',) + + _yang_name = 'ethernet-label-range' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tag_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=False) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'label-restrictions', 'label-restriction', 'ethernet-label-range'] + + def _get_tag_type(self): + """ + Getter method for tag_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/ethernet_label_range/tag_type (etht-types:eth-tag-type) + + YANG Description: VLAN tag type. + """ + return self.__tag_type + + def _set_tag_type(self, v, load=False): + """ + Setter method for tag_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/ethernet_label_range/tag_type (etht-types:eth-tag-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_tag_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tag_type() directly. + + YANG Description: VLAN tag type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tag_type must be of a type compatible with etht-types:eth-tag-type""", + 'defined-type': "etht-types:eth-tag-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=False)""", + }) + + self.__tag_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_tag_type(self): + self.__tag_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=False) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/ethernet_label_range/priority (uint8) + + YANG Description: priority. + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/ethernet_label_range/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: priority. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=False)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=False) + + tag_type = __builtin__.property(_get_tag_type) + priority = __builtin__.property(_get_priority) + + + _pyangbind_elements = OrderedDict([('tag_type', tag_type), ('priority', priority), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/__init__.py new file mode 100644 index 000000000..8c503e2b2 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/__init__.py @@ -0,0 +1,119 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_end(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/label-restrictions/label-restriction/label-end. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-end' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'label-restrictions', 'label-restriction', 'label-end'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_label = __builtin__.property(_get_te_label) + + + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/__init__.py new file mode 100644 index 000000000..de17adeb4 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/label-restrictions/label-restriction/label-end/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'label-restrictions', 'label-restriction', 'label-end', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/otn (container) + + YANG Description: Label start or label end for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label start or label end for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + vlanid = __builtin__.property(_get_vlanid) + direction = __builtin__.property(_get_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py new file mode 100644 index 000000000..459dceb1d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/label-restrictions/label-restriction/label-end/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label start or label end for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'label-restrictions', 'label-restriction', 'label-end', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/otn/ts (otn-ts) + + YANG Description: Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + + tpn = __builtin__.property(_get_tpn) + ts = __builtin__.property(_get_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/__init__.py new file mode 100644 index 000000000..1a8e4c4dc --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/__init__.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_start(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/label-restrictions/label-restriction/label-start. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-start' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'label-restrictions', 'label-restriction', 'label-start'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_label = __builtin__.property(_get_te_label) + + + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/__init__.py new file mode 100644 index 000000000..1f66e6dae --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/label-restrictions/label-restriction/label-start/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'label-restrictions', 'label-restriction', 'label-start', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/otn (container) + + YANG Description: Label start or label end for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label start or label end for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + vlanid = __builtin__.property(_get_vlanid) + direction = __builtin__.property(_get_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py new file mode 100644 index 000000000..ad22f6a15 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/label-restrictions/label-restriction/label-start/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label start or label end for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'label-restrictions', 'label-restriction', 'label-start', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/otn/ts (otn-ts) + + YANG Description: Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + + tpn = __builtin__.property(_get_tpn) + ts = __builtin__.property(_get_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/__init__.py new file mode 100644 index 000000000..42085f541 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/__init__.py @@ -0,0 +1,200 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class label_step(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/label-restrictions/label-restriction/label-step. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_step',) + + _yang_name = 'label-step' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__eth_step = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'label-restrictions', 'label-restriction', 'label-step'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/generic (int32) + + YANG Description: Label range step. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/generic (int32) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Label range step. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with int32""", + 'defined-type': "int32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/otn (container) + + YANG Description: Label step for OTN + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label step for OTN + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_eth_step(self): + """ + Getter method for eth_step, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/eth_step (uint16) + + YANG Description: Label step which represent possible increments for +an Ethernet VLAN tag. + """ + return self.__eth_step + + def _set_eth_step(self, v, load=False): + """ + Setter method for eth_step, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/eth_step (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_step is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_step() directly. + + YANG Description: Label step which represent possible increments for +an Ethernet VLAN tag. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_step must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=False)""", + }) + + self.__eth_step = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_step(self): + self.__eth_step = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + eth_step = __builtin__.property(_get_eth_step) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['eth_step']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_step', eth_step), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/otn/__init__.py new file mode 100644 index 000000000..138aacf1b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/otn/__init__.py @@ -0,0 +1,158 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/label-restrictions/label-restriction/label-step/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label step for OTN + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'label-restrictions', 'label-restriction', 'label-step', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/otn/tpn (otn-tpn) + + YANG Description: Label step which represents possible increments for +Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Label step which represents possible increments for +Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/otn/ts (otn-ts) + + YANG Description: Label step which represents possible increments for +Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/label_step/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Label step which represents possible increments for +Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=False) + + tpn = __builtin__.property(_get_tpn) + ts = __builtin__.property(_get_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/__init__.py new file mode 100644 index 000000000..b951f71cb --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/__init__.py @@ -0,0 +1,256 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn_label_range(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/label-restrictions/label-restriction/otn-label-range. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label range information for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__range_type','__tsg','__odu_type_list','__priority',) + + _yang_name = 'otn-label-range' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__range_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=False) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__odu_type_list = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'label-restrictions', 'label-restriction', 'otn-label-range'] + + def _get_range_type(self): + """ + Getter method for range_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/range_type (otn-label-range-type) + + YANG Description: The type of range (e.g., TPN or TS) +to which the label range applies + """ + return self.__range_type + + def _set_range_type(self, v, load=False): + """ + Setter method for range_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/range_type (otn-label-range-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_range_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_range_type() directly. + + YANG Description: The type of range (e.g., TPN or TS) +to which the label range applies + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """range_type must be of a type compatible with otn-label-range-type""", + 'defined-type': "ietf-otn-topology:otn-label-range-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=False)""", + }) + + self.__range_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_range_type(self): + self.__range_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=False) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/tsg (identityref) + + YANG Description: Tributary slot granularity (TSG) to which the label range +applies. + +This leaf MUST be present when the range-type is TS. + +This leaf MAY be omitted when mapping an ODUk over an OTUk +Link. In this case the range-type is tpn, with only one +entry (ODUk), and the tpn range has only one value (1). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary slot granularity (TSG) to which the label range +applies. + +This leaf MUST be present when the range-type is TS. + +This leaf MAY be omitted when mapping an ODUk over an OTUk +Link. In this case the range-type is tpn, with only one +entry (ODUk), and the tpn range has only one value (1). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_odu_type_list(self): + """ + Getter method for odu_type_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/odu_type_list (identityref) + + YANG Description: List of ODU types to which the label range applies. + +An Empty odu-type-list means that the label range +applies to all the supported ODU types. + """ + return self.__odu_type_list + + def _set_odu_type_list(self, v, load=False): + """ + Setter method for odu_type_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/odu_type_list (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type_list() directly. + + YANG Description: List of ODU types to which the label range applies. + +An Empty odu-type-list means that the label range +applies to all the supported ODU types. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type_list must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__odu_type_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type_list(self): + self.__odu_type_list = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/priority (uint8) + + YANG Description: Priority in Interface Switching Capability +Descriptor (ISCD). + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: Priority in Interface Switching Capability +Descriptor (ISCD). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=False)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=False) + + range_type = __builtin__.property(_get_range_type) + tsg = __builtin__.property(_get_tsg) + odu_type_list = __builtin__.property(_get_odu_type_list) + priority = __builtin__.property(_get_priority) + + + _pyangbind_elements = OrderedDict([('range_type', range_type), ('tsg', tsg), ('odu_type_list', odu_type_list), ('priority', priority), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/__init__.py new file mode 100644 index 000000000..a561f8138 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/__init__.py @@ -0,0 +1,199 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import optimization_metric +from . import tiebreakers +from . import objective_function +class optimizations(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + __slots__ = ('_path_helper', '_extmethods', '__optimization_metric','__tiebreakers','__objective_function',) + + _yang_name = 'optimizations' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__optimization_metric = YANGDynClass(base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + self.__tiebreakers = YANGDynClass(base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__objective_function = YANGDynClass(base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations'] + + def _get_optimization_metric(self): + """ + Getter method for optimization_metric, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric (list) + + YANG Description: TE path metric type. + """ + return self.__optimization_metric + + def _set_optimization_metric(self, v, load=False): + """ + Setter method for optimization_metric, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_optimization_metric is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_optimization_metric() directly. + + YANG Description: TE path metric type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """optimization_metric must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__optimization_metric = t + if hasattr(self, '_set'): + self._set() + + def _unset_optimization_metric(self): + self.__optimization_metric = YANGDynClass(base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + + def _get_tiebreakers(self): + """ + Getter method for tiebreakers, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/tiebreakers (container) + + YANG Description: Container for the list of tiebreakers. + """ + return self.__tiebreakers + + def _set_tiebreakers(self, v, load=False): + """ + Setter method for tiebreakers, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/tiebreakers (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tiebreakers is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tiebreakers() directly. + + YANG Description: Container for the list of tiebreakers. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tiebreakers must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__tiebreakers = t + if hasattr(self, '_set'): + self._set() + + def _unset_tiebreakers(self): + self.__tiebreakers = YANGDynClass(base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_objective_function(self): + """ + Getter method for objective_function, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/objective_function (container) + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + return self.__objective_function + + def _set_objective_function(self, v, load=False): + """ + Setter method for objective_function, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/objective_function (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_objective_function is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_objective_function() directly. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """objective_function must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__objective_function = t + if hasattr(self, '_set'): + self._set() + + def _unset_objective_function(self): + self.__objective_function = YANGDynClass(base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + optimization_metric = __builtin__.property(_get_optimization_metric) + tiebreakers = __builtin__.property(_get_tiebreakers) + objective_function = __builtin__.property(_get_objective_function) + + __choices__ = {'algorithm': {'metric': ['optimization_metric', 'tiebreakers'], 'objective-function': ['objective_function']}} + _pyangbind_elements = OrderedDict([('optimization_metric', optimization_metric), ('tiebreakers', tiebreakers), ('objective_function', objective_function), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/objective_function/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/objective_function/__init__.py new file mode 100644 index 000000000..a5742ea30 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/objective_function/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class objective_function(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/objective-function. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + __slots__ = ('_path_helper', '_extmethods', '__objective_function_type',) + + _yang_name = 'objective-function' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__objective_function_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'objective-function'] + + def _get_objective_function_type(self): + """ + Getter method for objective_function_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/objective_function/objective_function_type (identityref) + + YANG Description: Objective function entry. + """ + return self.__objective_function_type + + def _set_objective_function_type(self, v, load=False): + """ + Setter method for objective_function_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/objective_function/objective_function_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_objective_function_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_objective_function_type() directly. + + YANG Description: Objective function entry. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """objective_function_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__objective_function_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_objective_function_type(self): + self.__objective_function_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + objective_function_type = __builtin__.property(_get_objective_function_type) + + __choices__ = {'algorithm': {'objective-function': ['objective_function_type']}} + _pyangbind_elements = OrderedDict([('objective_function_type', objective_function_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/__init__.py new file mode 100644 index 000000000..de3425526 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/__init__.py @@ -0,0 +1,241 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import explicit_route_exclude_objects +from . import explicit_route_include_objects +class optimization_metric(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/optimization-metric. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE path metric type. + """ + __slots__ = ('_path_helper', '_extmethods', '__metric_type','__weight','__explicit_route_exclude_objects','__explicit_route_include_objects',) + + _yang_name = 'optimization-metric' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__weight = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + self.__explicit_route_exclude_objects = YANGDynClass(base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__explicit_route_include_objects = YANGDynClass(base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'optimization-metric'] + + def _get_metric_type(self): + """ + Getter method for metric_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/metric_type (identityref) + + YANG Description: Identifies the 'metric-type' that the path computation +process uses for optimization. + """ + return self.__metric_type + + def _set_metric_type(self, v, load=False): + """ + Setter method for metric_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/metric_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_metric_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_metric_type() directly. + + YANG Description: Identifies the 'metric-type' that the path computation +process uses for optimization. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """metric_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__metric_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_metric_type(self): + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_weight(self): + """ + Getter method for weight, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/weight (uint8) + + YANG Description: TE path metric normalization weight. + """ + return self.__weight + + def _set_weight(self, v, load=False): + """ + Setter method for weight, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/weight (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_weight is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_weight() directly. + + YANG Description: TE path metric normalization weight. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """weight must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False)""", + }) + + self.__weight = t + if hasattr(self, '_set'): + self._set() + + def _unset_weight(self): + self.__weight = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + + + def _get_explicit_route_exclude_objects(self): + """ + Getter method for explicit_route_exclude_objects, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects (container) + + YANG Description: Container for the 'exclude route' object list. + """ + return self.__explicit_route_exclude_objects + + def _set_explicit_route_exclude_objects(self, v, load=False): + """ + Setter method for explicit_route_exclude_objects, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_explicit_route_exclude_objects is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_explicit_route_exclude_objects() directly. + + YANG Description: Container for the 'exclude route' object list. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """explicit_route_exclude_objects must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__explicit_route_exclude_objects = t + if hasattr(self, '_set'): + self._set() + + def _unset_explicit_route_exclude_objects(self): + self.__explicit_route_exclude_objects = YANGDynClass(base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_explicit_route_include_objects(self): + """ + Getter method for explicit_route_include_objects, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects (container) + + YANG Description: Container for the 'include route' object list. + """ + return self.__explicit_route_include_objects + + def _set_explicit_route_include_objects(self, v, load=False): + """ + Setter method for explicit_route_include_objects, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_explicit_route_include_objects is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_explicit_route_include_objects() directly. + + YANG Description: Container for the 'include route' object list. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """explicit_route_include_objects must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__explicit_route_include_objects = t + if hasattr(self, '_set'): + self._set() + + def _unset_explicit_route_include_objects(self): + self.__explicit_route_include_objects = YANGDynClass(base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + metric_type = __builtin__.property(_get_metric_type) + weight = __builtin__.property(_get_weight) + explicit_route_exclude_objects = __builtin__.property(_get_explicit_route_exclude_objects) + explicit_route_include_objects = __builtin__.property(_get_explicit_route_include_objects) + + __choices__ = {'algorithm': {'metric': ['metric_type', 'weight', 'explicit_route_exclude_objects', 'explicit_route_include_objects']}} + _pyangbind_elements = OrderedDict([('metric_type', metric_type), ('weight', weight), ('explicit_route_exclude_objects', explicit_route_exclude_objects), ('explicit_route_include_objects', explicit_route_include_objects), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/__init__.py new file mode 100644 index 000000000..6df6741a9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import route_object_exclude_object +class explicit_route_exclude_objects(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/optimization-metric/explicit-route-exclude-objects. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the 'exclude route' object list. + """ + __slots__ = ('_path_helper', '_extmethods', '__route_object_exclude_object',) + + _yang_name = 'explicit-route-exclude-objects' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__route_object_exclude_object = YANGDynClass(base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects'] + + def _get_route_object_exclude_object(self): + """ + Getter method for route_object_exclude_object, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object (list) + + YANG Description: List of Explicit Route Objects to be excluded in the +path computation. + """ + return self.__route_object_exclude_object + + def _set_route_object_exclude_object(self, v, load=False): + """ + Setter method for route_object_exclude_object, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_route_object_exclude_object is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_route_object_exclude_object() directly. + + YANG Description: List of Explicit Route Objects to be excluded in the +path computation. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """route_object_exclude_object must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__route_object_exclude_object = t + if hasattr(self, '_set'): + self._set() + + def _unset_route_object_exclude_object(self): + self.__route_object_exclude_object = YANGDynClass(base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + route_object_exclude_object = __builtin__.property(_get_route_object_exclude_object) + + __choices__ = {'algorithm': {'metric': ['route_object_exclude_object']}} + _pyangbind_elements = OrderedDict([('route_object_exclude_object', route_object_exclude_object), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py new file mode 100644 index 000000000..66415fe3b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py @@ -0,0 +1,365 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +from . import srlg +class route_object_exclude_object(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of Explicit Route Objects to be excluded in the +path computation. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop','__srlg',) + + _yang_name = 'route-object-exclude-object' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__srlg = YANGDynClass(base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/index (uint32) + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/index (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_srlg(self): + """ + Getter method for srlg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg (container) + + YANG Description: SRLG container. + """ + return self.__srlg + + def _set_srlg(self, v, load=False): + """ + Setter method for srlg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_srlg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_srlg() directly. + + YANG Description: SRLG container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """srlg must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__srlg = t + if hasattr(self, '_set'): + self._set() + + def _unset_srlg(self): + self.__srlg = YANGDynClass(base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + index = __builtin__.property(_get_index) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop) + label_hop = __builtin__.property(_get_label_hop) + srlg = __builtin__.property(_get_srlg) + + __choices__ = {'algorithm': {'metric': ['index']}, 'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop'], 'srlg': ['srlg']}} + _pyangbind_elements = OrderedDict([('index', index), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ('srlg', srlg), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/__init__.py new file mode 100644 index 000000000..267567f74 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + as_number = __builtin__.property(_get_as_number) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/__init__.py new file mode 100644 index 000000000..dfb42f946 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_label = __builtin__.property(_get_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/__init__.py new file mode 100644 index 000000000..22dc3125e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + vlanid = __builtin__.property(_get_vlanid) + direction = __builtin__.property(_get_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/__init__.py new file mode 100644 index 000000000..687069414 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + + tpn = __builtin__.property(_get_tpn) + tsg = __builtin__.property(_get_tsg) + ts_list = __builtin__.property(_get_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/__init__.py new file mode 100644 index 000000000..5981ace64 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/__init__.py new file mode 100644 index 000000000..e42736cbe --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/__init__.py new file mode 100644 index 000000000..fcd5a3c7e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/__init__.py @@ -0,0 +1,115 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class srlg(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/srlg. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: SRLG container. + """ + __slots__ = ('_path_helper', '_extmethods', '__srlg',) + + _yang_name = 'srlg' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__srlg = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'srlg'] + + def _get_srlg(self): + """ + Getter method for srlg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/srlg (uint32) + + YANG Description: SRLG value. + """ + return self.__srlg + + def _set_srlg(self, v, load=False): + """ + Setter method for srlg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/srlg (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_srlg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_srlg() directly. + + YANG Description: SRLG value. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """srlg must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False)""", + }) + + self.__srlg = t + if hasattr(self, '_set'): + self._set() + + def _unset_srlg(self): + self.__srlg = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + srlg = __builtin__.property(_get_srlg) + + __choices__ = {'type': {'srlg': ['srlg']}} + _pyangbind_elements = OrderedDict([('srlg', srlg), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/__init__.py new file mode 100644 index 000000000..487e25e73 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/__init__.py new file mode 100644 index 000000000..06b2702da --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import route_object_include_object +class explicit_route_include_objects(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/optimization-metric/explicit-route-include-objects. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the 'include route' object list. + """ + __slots__ = ('_path_helper', '_extmethods', '__route_object_include_object',) + + _yang_name = 'explicit-route-include-objects' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__route_object_include_object = YANGDynClass(base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-include-objects'] + + def _get_route_object_include_object(self): + """ + Getter method for route_object_include_object, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object (list) + + YANG Description: List of Explicit Route Objects to be included in the +path computation. + """ + return self.__route_object_include_object + + def _set_route_object_include_object(self, v, load=False): + """ + Setter method for route_object_include_object, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_route_object_include_object is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_route_object_include_object() directly. + + YANG Description: List of Explicit Route Objects to be included in the +path computation. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """route_object_include_object must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__route_object_include_object = t + if hasattr(self, '_set'): + self._set() + + def _unset_route_object_include_object(self): + self.__route_object_include_object = YANGDynClass(base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + route_object_include_object = __builtin__.property(_get_route_object_include_object) + + __choices__ = {'algorithm': {'metric': ['route_object_include_object']}} + _pyangbind_elements = OrderedDict([('route_object_include_object', route_object_include_object), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py new file mode 100644 index 000000000..0b7b9e7e8 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py @@ -0,0 +1,325 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class route_object_include_object(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of Explicit Route Objects to be included in the +path computation. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'route-object-include-object' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/index (uint32) + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/index (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + index = __builtin__.property(_get_index) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop) + label_hop = __builtin__.property(_get_label_hop) + + __choices__ = {'algorithm': {'metric': ['index']}, 'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('index', index), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/__init__.py new file mode 100644 index 000000000..a30ba2c88 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + as_number = __builtin__.property(_get_as_number) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/__init__.py new file mode 100644 index 000000000..5adb8788e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_label = __builtin__.property(_get_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/__init__.py new file mode 100644 index 000000000..9494b4fda --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + vlanid = __builtin__.property(_get_vlanid) + direction = __builtin__.property(_get_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/__init__.py new file mode 100644 index 000000000..030f51b1f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + + tpn = __builtin__.property(_get_tpn) + tsg = __builtin__.property(_get_tsg) + ts_list = __builtin__.property(_get_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/__init__.py new file mode 100644 index 000000000..50a4caad8 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/__init__.py new file mode 100644 index 000000000..6952ba89b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/__init__.py new file mode 100644 index 000000000..a4ec3b3a9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/tiebreakers/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/tiebreakers/__init__.py new file mode 100644 index 000000000..3357913dd --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/tiebreakers/__init__.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import tiebreaker +class tiebreakers(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/tiebreakers. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of tiebreakers. + """ + __slots__ = ('_path_helper', '_extmethods', '__tiebreaker',) + + _yang_name = 'tiebreakers' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tiebreaker = YANGDynClass(base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'tiebreakers'] + + def _get_tiebreaker(self): + """ + Getter method for tiebreaker, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/tiebreakers/tiebreaker (list) + + YANG Description: The list of tiebreaker criteria to apply on an +equally favored set of paths, in order to pick +the best. + """ + return self.__tiebreaker + + def _set_tiebreaker(self, v, load=False): + """ + Setter method for tiebreaker, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/tiebreakers/tiebreaker (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_tiebreaker is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tiebreaker() directly. + + YANG Description: The list of tiebreaker criteria to apply on an +equally favored set of paths, in order to pick +the best. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tiebreaker must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__tiebreaker = t + if hasattr(self, '_set'): + self._set() + + def _unset_tiebreaker(self): + self.__tiebreaker = YANGDynClass(base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + tiebreaker = __builtin__.property(_get_tiebreaker) + + __choices__ = {'algorithm': {'metric': ['tiebreaker']}} + _pyangbind_elements = OrderedDict([('tiebreaker', tiebreaker), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/tiebreakers/tiebreaker/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/tiebreakers/tiebreaker/__init__.py new file mode 100644 index 000000000..4478acced --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/tiebreakers/tiebreaker/__init__.py @@ -0,0 +1,122 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class tiebreaker(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/optimizations/tiebreakers/tiebreaker. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The list of tiebreaker criteria to apply on an +equally favored set of paths, in order to pick +the best. + """ + __slots__ = ('_path_helper', '_extmethods', '__tiebreaker_type',) + + _yang_name = 'tiebreaker' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tiebreaker_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'optimizations', 'tiebreakers', 'tiebreaker'] + + def _get_tiebreaker_type(self): + """ + Getter method for tiebreaker_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/tiebreakers/tiebreaker/tiebreaker_type (identityref) + + YANG Description: Identifies an entry in the list of tiebreakers. + """ + return self.__tiebreaker_type + + def _set_tiebreaker_type(self, v, load=False): + """ + Setter method for tiebreaker_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/optimizations/tiebreakers/tiebreaker/tiebreaker_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tiebreaker_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tiebreaker_type() directly. + + YANG Description: Identifies an entry in the list of tiebreakers. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tiebreaker_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__tiebreaker_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_tiebreaker_type(self): + self.__tiebreaker_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + tiebreaker_type = __builtin__.property(_get_tiebreaker_type) + + __choices__ = {'algorithm': {'metric': ['tiebreaker_type']}} + _pyangbind_elements = OrderedDict([('tiebreaker_type', tiebreaker_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/__init__.py new file mode 100644 index 000000000..74807897d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/__init__.py @@ -0,0 +1,523 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_bandwidth +from . import path_metric_bounds +from . import path_affinities_values +from . import path_affinity_names +from . import path_srlgs_lists +from . import path_srlgs_names +class path_constraints(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-constraints. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE named path constraints container. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_bandwidth','__link_protection','__setup_priority','__hold_priority','__signaling_type','__path_metric_bounds','__path_affinities_values','__path_affinity_names','__path_srlgs_lists','__path_srlgs_names','__disjointness',) + + _yang_name = 'path-constraints' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__link_protection = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__setup_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + self.__hold_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + self.__signaling_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__path_metric_bounds = YANGDynClass(base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__disjointness = YANGDynClass(base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-constraints'] + + def _get_te_bandwidth(self): + """ + Getter method for te_bandwidth, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth (container) + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + return self.__te_bandwidth + + def _set_te_bandwidth(self, v, load=False): + """ + Setter method for te_bandwidth, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_bandwidth() directly. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_bandwidth(self): + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_link_protection(self): + """ + Getter method for link_protection, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/link_protection (identityref) + + YANG Description: Link protection type required for the links included +in the computed path. + """ + return self.__link_protection + + def _set_link_protection(self, v, load=False): + """ + Setter method for link_protection, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/link_protection (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_protection is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_protection() directly. + + YANG Description: Link protection type required for the links included +in the computed path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_protection must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__link_protection = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_protection(self): + self.__link_protection = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_setup_priority(self): + """ + Getter method for setup_priority, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/setup_priority (uint8) + + YANG Description: TE LSP requested setup priority. + """ + return self.__setup_priority + + def _set_setup_priority(self, v, load=False): + """ + Setter method for setup_priority, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/setup_priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_setup_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_setup_priority() directly. + + YANG Description: TE LSP requested setup priority. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """setup_priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False)""", + }) + + self.__setup_priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_setup_priority(self): + self.__setup_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + + + def _get_hold_priority(self): + """ + Getter method for hold_priority, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/hold_priority (uint8) + + YANG Description: TE LSP requested hold priority. + """ + return self.__hold_priority + + def _set_hold_priority(self, v, load=False): + """ + Setter method for hold_priority, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/hold_priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_hold_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hold_priority() directly. + + YANG Description: TE LSP requested hold priority. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hold_priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False)""", + }) + + self.__hold_priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_hold_priority(self): + self.__hold_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=False) + + + def _get_signaling_type(self): + """ + Getter method for signaling_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/signaling_type (identityref) + + YANG Description: TE tunnel path signaling type. + """ + return self.__signaling_type + + def _set_signaling_type(self, v, load=False): + """ + Setter method for signaling_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/signaling_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_signaling_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_signaling_type() directly. + + YANG Description: TE tunnel path signaling type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """signaling_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__signaling_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_signaling_type(self): + self.__signaling_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_path_metric_bounds(self): + """ + Getter method for path_metric_bounds, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_metric_bounds (container) + + YANG Description: TE path metric bounds container. + """ + return self.__path_metric_bounds + + def _set_path_metric_bounds(self, v, load=False): + """ + Setter method for path_metric_bounds, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_metric_bounds (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_metric_bounds is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_metric_bounds() directly. + + YANG Description: TE path metric bounds container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_metric_bounds must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_metric_bounds = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_metric_bounds(self): + self.__path_metric_bounds = YANGDynClass(base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_affinities_values(self): + """ + Getter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinities_values (container) + + YANG Description: Path affinities represented as values. + """ + return self.__path_affinities_values + + def _set_path_affinities_values(self, v, load=False): + """ + Setter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinities_values (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_values() directly. + + YANG Description: Path affinities represented as values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_values must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_affinities_values = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_values(self): + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_affinity_names(self): + """ + Getter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names (container) + + YANG Description: Path affinities represented as names. + """ + return self.__path_affinity_names + + def _set_path_affinity_names(self, v, load=False): + """ + Setter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_names() directly. + + YANG Description: Path affinities represented as names. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_affinity_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_names(self): + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_srlgs_lists(self): + """ + Getter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_lists (container) + + YANG Description: Path SRLG properties container. + """ + return self.__path_srlgs_lists + + def _set_path_srlgs_lists(self, v, load=False): + """ + Setter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_lists (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_lists is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_lists() directly. + + YANG Description: Path SRLG properties container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_lists must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_srlgs_lists = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_lists(self): + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_srlgs_names(self): + """ + Getter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_names (container) + + YANG Description: Container for the list of named SRLGs. + """ + return self.__path_srlgs_names + + def _set_path_srlgs_names(self, v, load=False): + """ + Setter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_names() directly. + + YANG Description: Container for the list of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_srlgs_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_names(self): + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_disjointness(self): + """ + Getter method for disjointness, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/disjointness (te-path-disjointness) + + YANG Description: The type of resource disjointness. +When configured for a primary path, the disjointness level +applies to all secondary LSPs. When configured for a +secondary path, the disjointness level overrides the level +configured for the primary path. + """ + return self.__disjointness + + def _set_disjointness(self, v, load=False): + """ + Setter method for disjointness, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/disjointness (te-path-disjointness) + If this variable is read-only (config: false) in the + source YANG file, then _set_disjointness is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_disjointness() directly. + + YANG Description: The type of resource disjointness. +When configured for a primary path, the disjointness level +applies to all secondary LSPs. When configured for a +secondary path, the disjointness level overrides the level +configured for the primary path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """disjointness must be of a type compatible with te-path-disjointness""", + 'defined-type': "ietf-te-topology:te-path-disjointness", + 'generated-type': """YANGDynClass(base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', is_config=False)""", + }) + + self.__disjointness = t + if hasattr(self, '_set'): + self._set() + + def _unset_disjointness(self): + self.__disjointness = YANGDynClass(base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', is_config=False) + + te_bandwidth = __builtin__.property(_get_te_bandwidth) + link_protection = __builtin__.property(_get_link_protection) + setup_priority = __builtin__.property(_get_setup_priority) + hold_priority = __builtin__.property(_get_hold_priority) + signaling_type = __builtin__.property(_get_signaling_type) + path_metric_bounds = __builtin__.property(_get_path_metric_bounds) + path_affinities_values = __builtin__.property(_get_path_affinities_values) + path_affinity_names = __builtin__.property(_get_path_affinity_names) + path_srlgs_lists = __builtin__.property(_get_path_srlgs_lists) + path_srlgs_names = __builtin__.property(_get_path_srlgs_names) + disjointness = __builtin__.property(_get_disjointness) + + + _pyangbind_elements = OrderedDict([('te_bandwidth', te_bandwidth), ('link_protection', link_protection), ('setup_priority', setup_priority), ('hold_priority', hold_priority), ('signaling_type', signaling_type), ('path_metric_bounds', path_metric_bounds), ('path_affinities_values', path_affinities_values), ('path_affinity_names', path_affinity_names), ('path_srlgs_lists', path_srlgs_lists), ('path_srlgs_names', path_srlgs_names), ('disjointness', disjointness), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinities_values/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinities_values/__init__.py new file mode 100644 index 000000000..4f42a2ac9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinities_values/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_affinities_value +class path_affinities_values(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-constraints/path-affinities-values. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as values. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinities_value',) + + _yang_name = 'path-affinities-values' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-constraints', 'path-affinities-values'] + + def _get_path_affinities_value(self): + """ + Getter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinities_value + + def _set_path_affinities_value(self, v, load=False): + """ + Setter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_value() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_value must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_affinities_value = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_value(self): + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_affinities_value = __builtin__.property(_get_path_affinities_value) + + + _pyangbind_elements = OrderedDict([('path_affinities_value', path_affinities_value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value/__init__.py new file mode 100644 index 000000000..cd1a2c6ed --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value/__init__.py @@ -0,0 +1,161 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_affinities_value(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-constraints/path-affinities-values/path-affinities-value. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__value',) + + _yang_name = 'path-affinities-value' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-constraints', 'path-affinities-values', 'path-affinities-value'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value/usage (identityref) + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_value(self): + """ + Getter method for value, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value/value (admin-groups) + + YANG Description: The affinity value. The default is empty. + """ + return self.__value + + def _set_value(self, v, load=False): + """ + Setter method for value, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value/value (admin-groups) + If this variable is read-only (config: false) in the + source YANG file, then _set_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_value() directly. + + YANG Description: The affinity value. The default is empty. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """value must be of a type compatible with admin-groups""", + 'defined-type': "ietf-te-topology:admin-groups", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False)""", + }) + + self.__value = t + if hasattr(self, '_set'): + self._set() + + def _unset_value(self): + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False) + + usage = __builtin__.property(_get_usage) + value = __builtin__.property(_get_value) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('value', value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/__init__.py new file mode 100644 index 000000000..a7f5be85b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_affinity_name +class path_affinity_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-constraints/path-affinity-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as names. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinity_name',) + + _yang_name = 'path-affinity-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-constraints', 'path-affinity-names'] + + def _get_path_affinity_name(self): + """ + Getter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinity_name + + def _set_path_affinity_name(self, v, load=False): + """ + Setter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_name() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_name(self): + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_affinity_name = __builtin__.property(_get_path_affinity_name) + + + _pyangbind_elements = OrderedDict([('path_affinity_name', path_affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/__init__.py new file mode 100644 index 000000000..67a1ea760 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/__init__.py @@ -0,0 +1,162 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import affinity_name +class path_affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-constraints/path-affinity-names/path-affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__affinity_name',) + + _yang_name = 'path-affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-constraints', 'path-affinity-names', 'path-affinity-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/usage (identityref) + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_affinity_name(self): + """ + Getter method for affinity_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/affinity_name (list) + + YANG Description: List of named affinities. + """ + return self.__affinity_name + + def _set_affinity_name(self, v, load=False): + """ + Setter method for affinity_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_affinity_name() directly. + + YANG Description: List of named affinities. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_affinity_name(self): + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + usage = __builtin__.property(_get_usage) + affinity_name = __builtin__.property(_get_affinity_name) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('affinity_name', affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py new file mode 100644 index 000000000..e97d6d57e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-constraints/path-affinity-names/path-affinity-name/affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinities. + """ + __slots__ = ('_path_helper', '_extmethods', '__name',) + + _yang_name = 'affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-constraints', 'path-affinity-names', 'path-affinity-name', 'affinity-name'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/affinity_name/name (string) + + YANG Description: Identifies a named affinity entry. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/affinity_name/name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: Identifies a named affinity entry. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + name = __builtin__.property(_get_name) + + + _pyangbind_elements = OrderedDict([('name', name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_metric_bounds/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_metric_bounds/__init__.py new file mode 100644 index 000000000..92e0cb519 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_metric_bounds/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_metric_bound +class path_metric_bounds(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-constraints/path-metric-bounds. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE path metric bounds container. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_metric_bound',) + + _yang_name = 'path-metric-bounds' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_metric_bound = YANGDynClass(base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-constraints', 'path-metric-bounds'] + + def _get_path_metric_bound(self): + """ + Getter method for path_metric_bound, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound (list) + + YANG Description: List of TE path metric bounds. + """ + return self.__path_metric_bound + + def _set_path_metric_bound(self, v, load=False): + """ + Setter method for path_metric_bound, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_metric_bound is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_metric_bound() directly. + + YANG Description: List of TE path metric bounds. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_metric_bound must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_metric_bound = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_metric_bound(self): + self.__path_metric_bound = YANGDynClass(base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_metric_bound = __builtin__.property(_get_path_metric_bound) + + + _pyangbind_elements = OrderedDict([('path_metric_bound', path_metric_bound), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound/__init__.py new file mode 100644 index 000000000..74b7fca4e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound/__init__.py @@ -0,0 +1,165 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_metric_bound(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-constraints/path-metric-bounds/path-metric-bound. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of TE path metric bounds. + """ + __slots__ = ('_path_helper', '_extmethods', '__metric_type','__upper_bound',) + + _yang_name = 'path-metric-bound' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__upper_bound = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-constraints', 'path-metric-bounds', 'path-metric-bound'] + + def _get_metric_type(self): + """ + Getter method for metric_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound/metric_type (identityref) + + YANG Description: Identifies an entry in the list of 'metric-type' items +bound for the TE path. + """ + return self.__metric_type + + def _set_metric_type(self, v, load=False): + """ + Setter method for metric_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound/metric_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_metric_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_metric_type() directly. + + YANG Description: Identifies an entry in the list of 'metric-type' items +bound for the TE path. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """metric_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__metric_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_metric_type(self): + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_upper_bound(self): + """ + Getter method for upper_bound, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound/upper_bound (uint64) + + YANG Description: Upper bound on the end-to-end TE path metric. A zero +indicates an unbounded upper limit for the specific +'metric-type'. + """ + return self.__upper_bound + + def _set_upper_bound(self, v, load=False): + """ + Setter method for upper_bound, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound/upper_bound (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_upper_bound is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_upper_bound() directly. + + YANG Description: Upper bound on the end-to-end TE path metric. A zero +indicates an unbounded upper limit for the specific +'metric-type'. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """upper_bound must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False)""", + }) + + self.__upper_bound = t + if hasattr(self, '_set'): + self._set() + + def _unset_upper_bound(self): + self.__upper_bound = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + + metric_type = __builtin__.property(_get_metric_type) + upper_bound = __builtin__.property(_get_upper_bound) + + + _pyangbind_elements = OrderedDict([('metric_type', metric_type), ('upper_bound', upper_bound), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_lists/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_lists/__init__.py new file mode 100644 index 000000000..8c1eb4e15 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_lists/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_srlgs_list +class path_srlgs_lists(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-constraints/path-srlgs-lists. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path SRLG properties container. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_list',) + + _yang_name = 'path-srlgs-lists' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-constraints', 'path-srlgs-lists'] + + def _get_path_srlgs_list(self): + """ + Getter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list (list) + + YANG Description: List of SRLG values to be included or excluded. + """ + return self.__path_srlgs_list + + def _set_path_srlgs_list(self, v, load=False): + """ + Setter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_list() directly. + + YANG Description: List of SRLG values to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_list must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_srlgs_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_list(self): + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_srlgs_list = __builtin__.property(_get_path_srlgs_list) + + + _pyangbind_elements = OrderedDict([('path_srlgs_list', path_srlgs_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py new file mode 100644 index 000000000..7ee7c8def --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py @@ -0,0 +1,161 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_srlgs_list(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-constraints/path-srlgs-lists/path-srlgs-list. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of SRLG values to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__values',) + + _yang_name = 'path-srlgs-list' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-constraints', 'path-srlgs-lists', 'path-srlgs-list'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list/usage (identityref) + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_values(self): + """ + Getter method for values, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list/values (srlg) + + YANG Description: List of SRLG values. + """ + return self.__values + + def _set_values(self, v, load=False): + """ + Setter method for values, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list/values (srlg) + If this variable is read-only (config: false) in the + source YANG file, then _set_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_values() directly. + + YANG Description: List of SRLG values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """values must be of a type compatible with srlg""", + 'defined-type': "ietf-te-topology:srlg", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False)""", + }) + + self.__values = t + if hasattr(self, '_set'): + self._set() + + def _unset_values(self): + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False) + + usage = __builtin__.property(_get_usage) + values = __builtin__.property(_get_values) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('values', values), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_names/__init__.py new file mode 100644 index 000000000..20ff89122 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_names/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_srlgs_name +class path_srlgs_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-constraints/path-srlgs-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of named SRLGs. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_name',) + + _yang_name = 'path-srlgs-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-constraints', 'path-srlgs-names'] + + def _get_path_srlgs_name(self): + """ + Getter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name (list) + + YANG Description: List of named SRLGs to be included or excluded. + """ + return self.__path_srlgs_name + + def _set_path_srlgs_name(self, v, load=False): + """ + Setter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_name() directly. + + YANG Description: List of named SRLGs to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_srlgs_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_name(self): + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_srlgs_name = __builtin__.property(_get_path_srlgs_name) + + + _pyangbind_elements = OrderedDict([('path_srlgs_name', path_srlgs_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py new file mode 100644 index 000000000..e04c9a278 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py @@ -0,0 +1,161 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_srlgs_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-constraints/path-srlgs-names/path-srlgs-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named SRLGs to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__names',) + + _yang_name = 'path-srlgs-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-constraints', 'path-srlgs-names', 'path-srlgs-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name/usage (identityref) + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_names(self): + """ + Getter method for names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name/names (string) + + YANG Description: List of named SRLGs. + """ + return self.__names + + def _set_names(self, v, load=False): + """ + Setter method for names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name/names (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_names() directly. + + YANG Description: List of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """names must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__names = t + if hasattr(self, '_set'): + self._set() + + def _unset_names(self): + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + usage = __builtin__.property(_get_usage) + names = __builtin__.property(_get_names) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('names', names), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/__init__.py new file mode 100644 index 000000000..044405806 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/__init__.py @@ -0,0 +1,195 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-constraints/te-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_bandwidth',) + + _yang_name = 'te-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-constraints', 'te-bandwidth'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/generic (te-bandwidth) + + YANG Description: Bandwidth specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/generic (te-bandwidth) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Bandwidth specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with te-bandwidth""", + 'defined-type': "ietf-te-topology:te-bandwidth", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/otn (container) + + YANG Description: Bandwidth attributes for OTN links + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Bandwidth attributes for OTN links + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_eth_bandwidth(self): + """ + Getter method for eth_bandwidth, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/eth_bandwidth (uint64) + + YANG Description: Available bandwith value expressed in kilobits per second + """ + return self.__eth_bandwidth + + def _set_eth_bandwidth(self, v, load=False): + """ + Setter method for eth_bandwidth, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/eth_bandwidth (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_bandwidth() directly. + + YANG Description: Available bandwith value expressed in kilobits per second + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_bandwidth must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=False)""", + }) + + self.__eth_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_bandwidth(self): + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + eth_bandwidth = __builtin__.property(_get_eth_bandwidth) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['eth_bandwidth']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_bandwidth', eth_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/otn/__init__.py new file mode 100644 index 000000000..cf1f3bd4c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/otn/__init__.py @@ -0,0 +1,163 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import odulist +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-constraints/te-bandwidth/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Bandwidth attributes for OTN links + """ + __slots__ = ('_path_helper', '_extmethods', '__odulist','__odtu_flex_type',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=False) + self.__odtu_flex_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-constraints', 'te-bandwidth', 'otn'] + + def _get_odulist(self): + """ + Getter method for odulist, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist (list) + + YANG Description: OTN bandwidth definition + """ + return self.__odulist + + def _set_odulist(self, v, load=False): + """ + Setter method for odulist, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_odulist is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odulist() directly. + + YANG Description: OTN bandwidth definition + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odulist must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=False)""", + }) + + self.__odulist = t + if hasattr(self, '_set'): + self._set() + + def _unset_odulist(self): + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=False) + + + def _get_odtu_flex_type(self): + """ + Getter method for odtu_flex_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/otn/odtu_flex_type (l1-types:odtu-flex-type) + + YANG Description: The type of Optical Data Tributary Unit (ODTU) +whose nominal bitrate is used to compute the number of +Tributary Slots (TS) required by the ODUflex LSPs +set up along the underlay paths of these OTN +connectivity matrices. + """ + return self.__odtu_flex_type + + def _set_odtu_flex_type(self, v, load=False): + """ + Setter method for odtu_flex_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/otn/odtu_flex_type (l1-types:odtu-flex-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_odtu_flex_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odtu_flex_type() directly. + + YANG Description: The type of Optical Data Tributary Unit (ODTU) +whose nominal bitrate is used to compute the number of +Tributary Slots (TS) required by the ODUflex LSPs +set up along the underlay paths of these OTN +connectivity matrices. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odtu_flex_type must be of a type compatible with l1-types:odtu-flex-type""", + 'defined-type': "l1-types:odtu-flex-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=False)""", + }) + + self.__odtu_flex_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odtu_flex_type(self): + self.__odtu_flex_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=False) + + odulist = __builtin__.property(_get_odulist) + odtu_flex_type = __builtin__.property(_get_odtu_flex_type) + + __choices__ = {'technology': {'otn': ['odulist', 'odtu_flex_type']}} + _pyangbind_elements = OrderedDict([('odulist', odulist), ('odtu_flex_type', odtu_flex_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist/__init__.py new file mode 100644 index 000000000..4e9960a67 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist/__init__.py @@ -0,0 +1,200 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class odulist(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-constraints/te-bandwidth/otn/odulist. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: OTN bandwidth definition + """ + __slots__ = ('_path_helper', '_extmethods', '__odu_type','__number','__ts_number',) + + _yang_name = 'odulist' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-constraints', 'te-bandwidth', 'otn', 'odulist'] + + def _get_odu_type(self): + """ + Getter method for odu_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist/odu_type (identityref) + + YANG Description: ODU type + """ + return self.__odu_type + + def _set_odu_type(self, v, load=False): + """ + Setter method for odu_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist/odu_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type() directly. + + YANG Description: ODU type + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__odu_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type(self): + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_number(self): + """ + Getter method for number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist/number (uint16) + + YANG Description: Number of ODUs + """ + return self.__number + + def _set_number(self, v, load=False): + """ + Setter method for number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist/number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_number() directly. + + YANG Description: Number of ODUs + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False)""", + }) + + self.__number = t + if hasattr(self, '_set'): + self._set() + + def _unset_number(self): + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + + + def _get_ts_number(self): + """ + Getter method for ts_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist/ts_number (uint16) + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + return self.__ts_number + + def _set_ts_number(self, v, load=False): + """ + Setter method for ts_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist/ts_number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_number() directly. + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False)""", + }) + + self.__ts_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_number(self): + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=False) + + odu_type = __builtin__.property(_get_odu_type) + number = __builtin__.property(_get_number) + ts_number = __builtin__.property(_get_ts_number) + + __choices__ = {'technology': {'otn': ['odu_type', 'number', 'ts_number']}} + _pyangbind_elements = OrderedDict([('odu_type', odu_type), ('number', number), ('ts_number', ts_number), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/__init__.py new file mode 100644 index 000000000..dfb5797aa --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/__init__.py @@ -0,0 +1,318 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_metric +from . import path_affinities_values +from . import path_affinity_names +from . import path_srlgs_lists +from . import path_srlgs_names +from . import path_route_objects +class path_properties(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-properties. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The TE path properties. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_metric','__path_affinities_values','__path_affinity_names','__path_srlgs_lists','__path_srlgs_names','__path_route_objects',) + + _yang_name = 'path-properties' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_metric = YANGDynClass(base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_route_objects = YANGDynClass(base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-properties'] + + def _get_path_metric(self): + """ + Getter method for path_metric, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_metric (list) + + YANG Description: TE path metric type. + """ + return self.__path_metric + + def _set_path_metric(self, v, load=False): + """ + Setter method for path_metric, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_metric (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_metric is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_metric() directly. + + YANG Description: TE path metric type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_metric must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_metric = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_metric(self): + self.__path_metric = YANGDynClass(base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + + def _get_path_affinities_values(self): + """ + Getter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinities_values (container) + + YANG Description: Path affinities represented as values. + """ + return self.__path_affinities_values + + def _set_path_affinities_values(self, v, load=False): + """ + Setter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinities_values (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_values() directly. + + YANG Description: Path affinities represented as values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_values must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_affinities_values = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_values(self): + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_affinity_names(self): + """ + Getter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names (container) + + YANG Description: Path affinities represented as names. + """ + return self.__path_affinity_names + + def _set_path_affinity_names(self, v, load=False): + """ + Setter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_names() directly. + + YANG Description: Path affinities represented as names. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_affinity_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_names(self): + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_srlgs_lists(self): + """ + Getter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_lists (container) + + YANG Description: Path SRLG properties container. + """ + return self.__path_srlgs_lists + + def _set_path_srlgs_lists(self, v, load=False): + """ + Setter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_lists (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_lists is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_lists() directly. + + YANG Description: Path SRLG properties container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_lists must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_srlgs_lists = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_lists(self): + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_srlgs_names(self): + """ + Getter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_names (container) + + YANG Description: Container for the list of named SRLGs. + """ + return self.__path_srlgs_names + + def _set_path_srlgs_names(self, v, load=False): + """ + Setter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_names() directly. + + YANG Description: Container for the list of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_srlgs_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_names(self): + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_route_objects(self): + """ + Getter method for path_route_objects, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects (container) + + YANG Description: Container for the list of route objects either returned by +the computation engine or actually used by an LSP. + """ + return self.__path_route_objects + + def _set_path_route_objects(self, v, load=False): + """ + Setter method for path_route_objects, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_route_objects is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_route_objects() directly. + + YANG Description: Container for the list of route objects either returned by +the computation engine or actually used by an LSP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_route_objects must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_route_objects = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_route_objects(self): + self.__path_route_objects = YANGDynClass(base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + path_metric = __builtin__.property(_get_path_metric) + path_affinities_values = __builtin__.property(_get_path_affinities_values) + path_affinity_names = __builtin__.property(_get_path_affinity_names) + path_srlgs_lists = __builtin__.property(_get_path_srlgs_lists) + path_srlgs_names = __builtin__.property(_get_path_srlgs_names) + path_route_objects = __builtin__.property(_get_path_route_objects) + + + _pyangbind_elements = OrderedDict([('path_metric', path_metric), ('path_affinities_values', path_affinities_values), ('path_affinity_names', path_affinity_names), ('path_srlgs_lists', path_srlgs_lists), ('path_srlgs_names', path_srlgs_names), ('path_route_objects', path_route_objects), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinities_values/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinities_values/__init__.py new file mode 100644 index 000000000..88aefb9b6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinities_values/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_affinities_value +class path_affinities_values(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-properties/path-affinities-values. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as values. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinities_value',) + + _yang_name = 'path-affinities-values' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-properties', 'path-affinities-values'] + + def _get_path_affinities_value(self): + """ + Getter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinities_value + + def _set_path_affinities_value(self, v, load=False): + """ + Setter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_value() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_value must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_affinities_value = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_value(self): + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_affinities_value = __builtin__.property(_get_path_affinities_value) + + + _pyangbind_elements = OrderedDict([('path_affinities_value', path_affinities_value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value/__init__.py new file mode 100644 index 000000000..92f7c3235 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value/__init__.py @@ -0,0 +1,161 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_affinities_value(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-properties/path-affinities-values/path-affinities-value. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__value',) + + _yang_name = 'path-affinities-value' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-properties', 'path-affinities-values', 'path-affinities-value'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value/usage (identityref) + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_value(self): + """ + Getter method for value, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value/value (admin-groups) + + YANG Description: The affinity value. The default is empty. + """ + return self.__value + + def _set_value(self, v, load=False): + """ + Setter method for value, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value/value (admin-groups) + If this variable is read-only (config: false) in the + source YANG file, then _set_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_value() directly. + + YANG Description: The affinity value. The default is empty. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """value must be of a type compatible with admin-groups""", + 'defined-type': "ietf-te-topology:admin-groups", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False)""", + }) + + self.__value = t + if hasattr(self, '_set'): + self._set() + + def _unset_value(self): + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False) + + usage = __builtin__.property(_get_usage) + value = __builtin__.property(_get_value) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('value', value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/__init__.py new file mode 100644 index 000000000..9b9de5d16 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_affinity_name +class path_affinity_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-properties/path-affinity-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as names. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinity_name',) + + _yang_name = 'path-affinity-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-properties', 'path-affinity-names'] + + def _get_path_affinity_name(self): + """ + Getter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinity_name + + def _set_path_affinity_name(self, v, load=False): + """ + Setter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_name() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_name(self): + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_affinity_name = __builtin__.property(_get_path_affinity_name) + + + _pyangbind_elements = OrderedDict([('path_affinity_name', path_affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/__init__.py new file mode 100644 index 000000000..ae1ed41e1 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/__init__.py @@ -0,0 +1,162 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import affinity_name +class path_affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-properties/path-affinity-names/path-affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__affinity_name',) + + _yang_name = 'path-affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-properties', 'path-affinity-names', 'path-affinity-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/usage (identityref) + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_affinity_name(self): + """ + Getter method for affinity_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/affinity_name (list) + + YANG Description: List of named affinities. + """ + return self.__affinity_name + + def _set_affinity_name(self, v, load=False): + """ + Setter method for affinity_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_affinity_name() directly. + + YANG Description: List of named affinities. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_affinity_name(self): + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + usage = __builtin__.property(_get_usage) + affinity_name = __builtin__.property(_get_affinity_name) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('affinity_name', affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py new file mode 100644 index 000000000..73aa7bee9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-properties/path-affinity-names/path-affinity-name/affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinities. + """ + __slots__ = ('_path_helper', '_extmethods', '__name',) + + _yang_name = 'affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-properties', 'path-affinity-names', 'path-affinity-name', 'affinity-name'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/affinity_name/name (string) + + YANG Description: Identifies a named affinity entry. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/affinity_name/name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: Identifies a named affinity entry. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + name = __builtin__.property(_get_name) + + + _pyangbind_elements = OrderedDict([('name', name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_metric/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_metric/__init__.py new file mode 100644 index 000000000..71b3184bd --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_metric/__init__.py @@ -0,0 +1,159 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_metric(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-properties/path-metric. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE path metric type. + """ + __slots__ = ('_path_helper', '_extmethods', '__metric_type','__accumulative_value',) + + _yang_name = 'path-metric' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__accumulative_value = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-properties', 'path-metric'] + + def _get_metric_type(self): + """ + Getter method for metric_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_metric/metric_type (identityref) + + YANG Description: TE path metric type. + """ + return self.__metric_type + + def _set_metric_type(self, v, load=False): + """ + Setter method for metric_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_metric/metric_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_metric_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_metric_type() directly. + + YANG Description: TE path metric type. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """metric_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__metric_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_metric_type(self): + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_accumulative_value(self): + """ + Getter method for accumulative_value, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_metric/accumulative_value (uint64) + + YANG Description: TE path metric accumulative value. + """ + return self.__accumulative_value + + def _set_accumulative_value(self, v, load=False): + """ + Setter method for accumulative_value, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_metric/accumulative_value (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_accumulative_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_accumulative_value() directly. + + YANG Description: TE path metric accumulative value. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """accumulative_value must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False)""", + }) + + self.__accumulative_value = t + if hasattr(self, '_set'): + self._set() + + def _unset_accumulative_value(self): + self.__accumulative_value = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + + metric_type = __builtin__.property(_get_metric_type) + accumulative_value = __builtin__.property(_get_accumulative_value) + + + _pyangbind_elements = OrderedDict([('metric_type', metric_type), ('accumulative_value', accumulative_value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/__init__.py new file mode 100644 index 000000000..b21cd85db --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/__init__.py @@ -0,0 +1,119 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_route_object +class path_route_objects(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-properties/path-route-objects. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of route objects either returned by +the computation engine or actually used by an LSP. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_route_object',) + + _yang_name = 'path-route-objects' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_route_object = YANGDynClass(base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-properties', 'path-route-objects'] + + def _get_path_route_object(self): + """ + Getter method for path_route_object, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object (list) + + YANG Description: List of route objects either returned by the computation +engine or actually used by an LSP. + """ + return self.__path_route_object + + def _set_path_route_object(self, v, load=False): + """ + Setter method for path_route_object, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_route_object is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_route_object() directly. + + YANG Description: List of route objects either returned by the computation +engine or actually used by an LSP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_route_object must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_route_object = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_route_object(self): + self.__path_route_object = YANGDynClass(base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_route_object = __builtin__.property(_get_path_route_object) + + + _pyangbind_elements = OrderedDict([('path_route_object', path_route_object), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/__init__.py new file mode 100644 index 000000000..c2331faf9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/__init__.py @@ -0,0 +1,327 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class path_route_object(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-properties/path-route-objects/path-route-object. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of route objects either returned by the computation +engine or actually used by an LSP. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'path-route-object' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-properties', 'path-route-objects', 'path-route-object'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/index (uint32) + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key +values. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/index (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key +values. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + index = __builtin__.property(_get_index) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop) + label_hop = __builtin__.property(_get_label_hop) + + __choices__ = {'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('index', index), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/as_number_hop/__init__.py new file mode 100644 index 000000000..86c07902e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-properties/path-route-objects/path-route-object/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-properties', 'path-route-objects', 'path-route-object', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + as_number = __builtin__.property(_get_as_number) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/__init__.py new file mode 100644 index 000000000..07d9666ae --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-properties/path-route-objects/path-route-object/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-properties', 'path-route-objects', 'path-route-object', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_label = __builtin__.property(_get_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/__init__.py new file mode 100644 index 000000000..1204a2ff4 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-properties/path-route-objects/path-route-object/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-properties', 'path-route-objects', 'path-route-object', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + vlanid = __builtin__.property(_get_vlanid) + direction = __builtin__.property(_get_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/__init__.py new file mode 100644 index 000000000..874d8ed5f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-properties/path-route-objects/path-route-object/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-properties', 'path-route-objects', 'path-route-object', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + + tpn = __builtin__.property(_get_tpn) + tsg = __builtin__.property(_get_tsg) + ts_list = __builtin__.property(_get_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop/__init__.py new file mode 100644 index 000000000..e41be3b4c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-properties/path-route-objects/path-route-object/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-properties', 'path-route-objects', 'path-route-object', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_node_hop/__init__.py new file mode 100644 index 000000000..eb07641c0 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-properties/path-route-objects/path-route-object/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-properties', 'path-route-objects', 'path-route-object', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_node_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/__init__.py new file mode 100644 index 000000000..e8eab3fc1 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-properties/path-route-objects/path-route-object/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-properties', 'path-route-objects', 'path-route-object', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_lists/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_lists/__init__.py new file mode 100644 index 000000000..a1b457c6c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_lists/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_srlgs_list +class path_srlgs_lists(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-properties/path-srlgs-lists. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path SRLG properties container. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_list',) + + _yang_name = 'path-srlgs-lists' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-properties', 'path-srlgs-lists'] + + def _get_path_srlgs_list(self): + """ + Getter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list (list) + + YANG Description: List of SRLG values to be included or excluded. + """ + return self.__path_srlgs_list + + def _set_path_srlgs_list(self, v, load=False): + """ + Setter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_list() directly. + + YANG Description: List of SRLG values to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_list must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_srlgs_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_list(self): + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_srlgs_list = __builtin__.property(_get_path_srlgs_list) + + + _pyangbind_elements = OrderedDict([('path_srlgs_list', path_srlgs_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py new file mode 100644 index 000000000..977077b1f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py @@ -0,0 +1,161 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_srlgs_list(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-properties/path-srlgs-lists/path-srlgs-list. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of SRLG values to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__values',) + + _yang_name = 'path-srlgs-list' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-properties', 'path-srlgs-lists', 'path-srlgs-list'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list/usage (identityref) + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_values(self): + """ + Getter method for values, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list/values (srlg) + + YANG Description: List of SRLG values. + """ + return self.__values + + def _set_values(self, v, load=False): + """ + Setter method for values, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list/values (srlg) + If this variable is read-only (config: false) in the + source YANG file, then _set_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_values() directly. + + YANG Description: List of SRLG values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """values must be of a type compatible with srlg""", + 'defined-type': "ietf-te-topology:srlg", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False)""", + }) + + self.__values = t + if hasattr(self, '_set'): + self._set() + + def _unset_values(self): + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False) + + usage = __builtin__.property(_get_usage) + values = __builtin__.property(_get_values) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('values', values), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_names/__init__.py new file mode 100644 index 000000000..219ef7d27 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_names/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_srlgs_name +class path_srlgs_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-properties/path-srlgs-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of named SRLGs. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_name',) + + _yang_name = 'path-srlgs-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-properties', 'path-srlgs-names'] + + def _get_path_srlgs_name(self): + """ + Getter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name (list) + + YANG Description: List of named SRLGs to be included or excluded. + """ + return self.__path_srlgs_name + + def _set_path_srlgs_name(self, v, load=False): + """ + Setter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_name() directly. + + YANG Description: List of named SRLGs to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_srlgs_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_name(self): + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_srlgs_name = __builtin__.property(_get_path_srlgs_name) + + + _pyangbind_elements = OrderedDict([('path_srlgs_name', path_srlgs_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name/__init__.py new file mode 100644 index 000000000..3f83850b9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name/__init__.py @@ -0,0 +1,161 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_srlgs_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/path-properties/path-srlgs-names/path-srlgs-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named SRLGs to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__names',) + + _yang_name = 'path-srlgs-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'path-properties', 'path-srlgs-names', 'path-srlgs-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name/usage (identityref) + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_names(self): + """ + Getter method for names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name/names (string) + + YANG Description: List of named SRLGs. + """ + return self.__names + + def _set_names(self, v, load=False): + """ + Setter method for names, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name/names (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_names() directly. + + YANG Description: List of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """names must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__names = t + if hasattr(self, '_set'): + self._set() + + def _unset_names(self): + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + usage = __builtin__.property(_get_usage) + names = __builtin__.property(_get_names) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('names', names), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/__init__.py new file mode 100644 index 000000000..1c61ee406 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/__init__.py @@ -0,0 +1,326 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import primary_path +from . import backup_path +from . import tunnel_termination_points +from . import tunnels +class underlay(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/underlay. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Attributes of the TE link underlay. + """ + __slots__ = ('_path_helper', '_extmethods', '__enabled','__primary_path','__backup_path','__protection_type','__tunnel_termination_points','__tunnels',) + + _yang_name = 'underlay' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__enabled = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + self.__primary_path = YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__backup_path = YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + self.__protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__tunnel_termination_points = YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__tunnels = YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'underlay'] + + def _get_enabled(self): + """ + Getter method for enabled, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/enabled (boolean) + + YANG Description: 'true' if the underlay is enabled. +'false' if the underlay is disabled. + """ + return self.__enabled + + def _set_enabled(self, v, load=False): + """ + Setter method for enabled, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/enabled (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_enabled is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_enabled() directly. + + YANG Description: 'true' if the underlay is enabled. +'false' if the underlay is disabled. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """enabled must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False)""", + }) + + self.__enabled = t + if hasattr(self, '_set'): + self._set() + + def _unset_enabled(self): + self.__enabled = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + + + def _get_primary_path(self): + """ + Getter method for primary_path, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path (container) + + YANG Description: The service path on the underlay topology that +supports this link. + """ + return self.__primary_path + + def _set_primary_path(self, v, load=False): + """ + Setter method for primary_path, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_primary_path is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_primary_path() directly. + + YANG Description: The service path on the underlay topology that +supports this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """primary_path must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__primary_path = t + if hasattr(self, '_set'): + self._set() + + def _unset_primary_path(self): + self.__primary_path = YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_backup_path(self): + """ + Getter method for backup_path, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path (list) + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + return self.__backup_path + + def _set_backup_path(self, v, load=False): + """ + Setter method for backup_path, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_backup_path is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_backup_path() directly. + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """backup_path must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__backup_path = t + if hasattr(self, '_set'): + self._set() + + def _unset_backup_path(self): + self.__backup_path = YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + + def _get_protection_type(self): + """ + Getter method for protection_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/protection_type (identityref) + + YANG Description: Underlay protection type desired for this link. + """ + return self.__protection_type + + def _set_protection_type(self, v, load=False): + """ + Setter method for protection_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/protection_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_protection_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_protection_type() directly. + + YANG Description: Underlay protection type desired for this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """protection_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__protection_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_protection_type(self): + self.__protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_tunnel_termination_points(self): + """ + Getter method for tunnel_termination_points, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnel_termination_points (container) + + YANG Description: Underlay TTPs desired for this link. + """ + return self.__tunnel_termination_points + + def _set_tunnel_termination_points(self, v, load=False): + """ + Setter method for tunnel_termination_points, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnel_termination_points (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel_termination_points is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel_termination_points() directly. + + YANG Description: Underlay TTPs desired for this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel_termination_points must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__tunnel_termination_points = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel_termination_points(self): + self.__tunnel_termination_points = YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_tunnels(self): + """ + Getter method for tunnels, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnels (container) + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + return self.__tunnels + + def _set_tunnels(self, v, load=False): + """ + Setter method for tunnels, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnels (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnels is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnels() directly. + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnels must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__tunnels = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnels(self): + self.__tunnels = YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + enabled = __builtin__.property(_get_enabled) + primary_path = __builtin__.property(_get_primary_path) + backup_path = __builtin__.property(_get_backup_path) + protection_type = __builtin__.property(_get_protection_type) + tunnel_termination_points = __builtin__.property(_get_tunnel_termination_points) + tunnels = __builtin__.property(_get_tunnels) + + + _pyangbind_elements = OrderedDict([('enabled', enabled), ('primary_path', primary_path), ('backup_path', backup_path), ('protection_type', protection_type), ('tunnel_termination_points', tunnel_termination_points), ('tunnels', tunnels), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/__init__.py new file mode 100644 index 000000000..92cc32717 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/__init__.py @@ -0,0 +1,207 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_element +class backup_path(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/underlay/backup-path. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__network_ref','__path_element',) + + _yang_name = 'backup-path' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'underlay', 'backup-path'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/index (uint32) + + YANG Description: A sequence number to identify a backup path. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/index (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: A sequence number to identify a backup path. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + + + def _get_path_element(self): + """ + Getter method for path_element, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element (list) + + YANG Description: A list of path elements describing the backup service +path. + """ + return self.__path_element + + def _set_path_element(self, v, load=False): + """ + Setter method for path_element, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element() directly. + + YANG Description: A list of path elements describing the backup service +path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_element = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element(self): + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + index = __builtin__.property(_get_index) + network_ref = __builtin__.property(_get_network_ref) + path_element = __builtin__.property(_get_path_element) + + + _pyangbind_elements = OrderedDict([('index', index), ('network_ref', network_ref), ('path_element', path_element), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/__init__.py new file mode 100644 index 000000000..782347073 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/__init__.py @@ -0,0 +1,321 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class path_element(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/underlay/backup-path/path-element. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of path elements describing the backup service +path. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_element_id','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'path-element' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'underlay', 'backup-path', 'path-element'] + + def _get_path_element_id(self): + """ + Getter method for path_element_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/path_element_id (uint32) + + YANG Description: To identify the element in a path. + """ + return self.__path_element_id + + def _set_path_element_id(self, v, load=False): + """ + Setter method for path_element_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/path_element_id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element_id() directly. + + YANG Description: To identify the element in a path. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element_id must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False)""", + }) + + self.__path_element_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element_id(self): + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + path_element_id = __builtin__.property(_get_path_element_id) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop) + label_hop = __builtin__.property(_get_label_hop) + + __choices__ = {'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('path_element_id', path_element_id), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/as_number_hop/__init__.py new file mode 100644 index 000000000..75444961d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/underlay/backup-path/path-element/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'underlay', 'backup-path', 'path-element', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + as_number = __builtin__.property(_get_as_number) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/__init__.py new file mode 100644 index 000000000..77ca590bd --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/underlay/backup-path/path-element/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'underlay', 'backup-path', 'path-element', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_label = __builtin__.property(_get_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/__init__.py new file mode 100644 index 000000000..ecefaca5f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/underlay/backup-path/path-element/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'underlay', 'backup-path', 'path-element', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + vlanid = __builtin__.property(_get_vlanid) + direction = __builtin__.property(_get_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py new file mode 100644 index 000000000..f9e7d7a3d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/underlay/backup-path/path-element/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'underlay', 'backup-path', 'path-element', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + + tpn = __builtin__.property(_get_tpn) + tsg = __builtin__.property(_get_tsg) + ts_list = __builtin__.property(_get_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop/__init__.py new file mode 100644 index 000000000..b1433a162 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/underlay/backup-path/path-element/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'underlay', 'backup-path', 'path-element', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/numbered_node_hop/__init__.py new file mode 100644 index 000000000..919cb958e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/underlay/backup-path/path-element/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'underlay', 'backup-path', 'path-element', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/numbered_node_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py new file mode 100644 index 000000000..4268b0489 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/underlay/backup-path/path-element/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'underlay', 'backup-path', 'path-element', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/__init__.py new file mode 100644 index 000000000..6f8297c24 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/__init__.py @@ -0,0 +1,158 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_element +class primary_path(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/underlay/primary-path. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The service path on the underlay topology that +supports this link. + """ + __slots__ = ('_path_helper', '_extmethods', '__network_ref','__path_element',) + + _yang_name = 'primary-path' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'underlay', 'primary-path'] + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + + + def _get_path_element(self): + """ + Getter method for path_element, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element (list) + + YANG Description: A list of path elements describing the service path. + """ + return self.__path_element + + def _set_path_element(self, v, load=False): + """ + Setter method for path_element, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element() directly. + + YANG Description: A list of path elements describing the service path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_element = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element(self): + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + network_ref = __builtin__.property(_get_network_ref) + path_element = __builtin__.property(_get_path_element) + + + _pyangbind_elements = OrderedDict([('network_ref', network_ref), ('path_element', path_element), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/__init__.py new file mode 100644 index 000000000..0c5b869f6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/__init__.py @@ -0,0 +1,320 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class path_element(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/underlay/primary-path/path-element. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of path elements describing the service path. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_element_id','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'path-element' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'underlay', 'primary-path', 'path-element'] + + def _get_path_element_id(self): + """ + Getter method for path_element_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/path_element_id (uint32) + + YANG Description: To identify the element in a path. + """ + return self.__path_element_id + + def _set_path_element_id(self, v, load=False): + """ + Setter method for path_element_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/path_element_id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element_id() directly. + + YANG Description: To identify the element in a path. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element_id must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False)""", + }) + + self.__path_element_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element_id(self): + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + path_element_id = __builtin__.property(_get_path_element_id) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop) + label_hop = __builtin__.property(_get_label_hop) + + __choices__ = {'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('path_element_id', path_element_id), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/as_number_hop/__init__.py new file mode 100644 index 000000000..f66d7136e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/underlay/primary-path/path-element/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'underlay', 'primary-path', 'path-element', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + as_number = __builtin__.property(_get_as_number) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/__init__.py new file mode 100644 index 000000000..591338404 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/underlay/primary-path/path-element/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'underlay', 'primary-path', 'path-element', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_label = __builtin__.property(_get_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/__init__.py new file mode 100644 index 000000000..5702d3150 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/underlay/primary-path/path-element/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'underlay', 'primary-path', 'path-element', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + vlanid = __builtin__.property(_get_vlanid) + direction = __builtin__.property(_get_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py new file mode 100644 index 000000000..7d8a5775c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/underlay/primary-path/path-element/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'underlay', 'primary-path', 'path-element', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + + tpn = __builtin__.property(_get_tpn) + tsg = __builtin__.property(_get_tsg) + ts_list = __builtin__.property(_get_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop/__init__.py new file mode 100644 index 000000000..ef124eada --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/underlay/primary-path/path-element/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'underlay', 'primary-path', 'path-element', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/numbered_node_hop/__init__.py new file mode 100644 index 000000000..15377f86d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/underlay/primary-path/path-element/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'underlay', 'primary-path', 'path-element', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/numbered_node_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py new file mode 100644 index 000000000..b950c2358 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/underlay/primary-path/path-element/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'underlay', 'primary-path', 'path-element', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnel_termination_points/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnel_termination_points/__init__.py new file mode 100644 index 000000000..f6a6987ff --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnel_termination_points/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class tunnel_termination_points(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/underlay/tunnel-termination-points. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Underlay TTPs desired for this link. + """ + __slots__ = ('_path_helper', '_extmethods', '__source','__destination',) + + _yang_name = 'tunnel-termination-points' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__source = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=False) + self.__destination = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'underlay', 'tunnel-termination-points'] + + def _get_source(self): + """ + Getter method for source, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnel_termination_points/source (binary) + + YANG Description: Source TTP identifier. + """ + return self.__source + + def _set_source(self, v, load=False): + """ + Setter method for source, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnel_termination_points/source (binary) + If this variable is read-only (config: false) in the + source YANG file, then _set_source is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_source() directly. + + YANG Description: Source TTP identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """source must be of a type compatible with binary""", + 'defined-type': "binary", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=False)""", + }) + + self.__source = t + if hasattr(self, '_set'): + self._set() + + def _unset_source(self): + self.__source = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=False) + + + def _get_destination(self): + """ + Getter method for destination, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnel_termination_points/destination (binary) + + YANG Description: Destination TTP identifier. + """ + return self.__destination + + def _set_destination(self, v, load=False): + """ + Setter method for destination, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnel_termination_points/destination (binary) + If this variable is read-only (config: false) in the + source YANG file, then _set_destination is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_destination() directly. + + YANG Description: Destination TTP identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """destination must be of a type compatible with binary""", + 'defined-type': "binary", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=False)""", + }) + + self.__destination = t + if hasattr(self, '_set'): + self._set() + + def _unset_destination(self): + self.__destination = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=False) + + source = __builtin__.property(_get_source) + destination = __builtin__.property(_get_destination) + + + _pyangbind_elements = OrderedDict([('source', source), ('destination', destination), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnels/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnels/__init__.py new file mode 100644 index 000000000..b1d6cf9df --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnels/__init__.py @@ -0,0 +1,167 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import tunnel +class tunnels(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/underlay/tunnels. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + __slots__ = ('_path_helper', '_extmethods', '__sharing','__tunnel',) + + _yang_name = 'tunnels' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__sharing = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + self.__tunnel = YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'underlay', 'tunnels'] + + def _get_sharing(self): + """ + Getter method for sharing, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnels/sharing (boolean) + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. +This leaf is the default option for all TE tunnels +and may be overridden by the per-TE-tunnel value. + """ + return self.__sharing + + def _set_sharing(self, v, load=False): + """ + Setter method for sharing, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnels/sharing (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_sharing is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_sharing() directly. + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. +This leaf is the default option for all TE tunnels +and may be overridden by the per-TE-tunnel value. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """sharing must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False)""", + }) + + self.__sharing = t + if hasattr(self, '_set'): + self._set() + + def _unset_sharing(self): + self.__sharing = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + + + def _get_tunnel(self): + """ + Getter method for tunnel, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnels/tunnel (list) + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + return self.__tunnel + + def _set_tunnel(self, v, load=False): + """ + Setter method for tunnel, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnels/tunnel (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel() directly. + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__tunnel = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel(self): + self.__tunnel = YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + sharing = __builtin__.property(_get_sharing) + tunnel = __builtin__.property(_get_tunnel) + + + _pyangbind_elements = OrderedDict([('sharing', sharing), ('tunnel', tunnel), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnels/tunnel/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnels/tunnel/__init__.py new file mode 100644 index 000000000..8f8593123 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnels/tunnel/__init__.py @@ -0,0 +1,170 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class tunnel(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/connectivity-matrices/underlay/tunnels/tunnel. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + __slots__ = ('_path_helper', '_extmethods', '__tunnel_name','__sharing',) + + _yang_name = 'tunnel' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tunnel_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + self.__sharing = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'connectivity-matrices', 'underlay', 'tunnels', 'tunnel'] + + def _get_tunnel_name(self): + """ + Getter method for tunnel_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnels/tunnel/tunnel_name (string) + + YANG Description: A tunnel name uniquely identifies an underlay TE tunnel, +used together with the 'source-node' value for this +link. + """ + return self.__tunnel_name + + def _set_tunnel_name(self, v, load=False): + """ + Setter method for tunnel_name, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnels/tunnel/tunnel_name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel_name() directly. + + YANG Description: A tunnel name uniquely identifies an underlay TE tunnel, +used together with the 'source-node' value for this +link. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel_name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__tunnel_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel_name(self): + self.__tunnel_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + + def _get_sharing(self): + """ + Getter method for sharing, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnels/tunnel/sharing (boolean) + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. + """ + return self.__sharing + + def _set_sharing(self, v, load=False): + """ + Setter method for sharing, mapped from YANG variable /networks/network/node/te/information_source_entry/connectivity_matrices/underlay/tunnels/tunnel/sharing (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_sharing is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_sharing() directly. + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """sharing must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False)""", + }) + + self.__sharing = t + if hasattr(self, '_set'): + self._set() + + def _unset_sharing(self): + self.__sharing = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=False) + + tunnel_name = __builtin__.property(_get_tunnel_name) + sharing = __builtin__.property(_get_sharing) + + + _pyangbind_elements = OrderedDict([('tunnel_name', tunnel_name), ('sharing', sharing), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/information_source_state/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/information_source_state/__init__.py new file mode 100644 index 000000000..1ee93c90f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/information_source_state/__init__.py @@ -0,0 +1,248 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import topology +class information_source_state(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/information-source-state. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains state attributes related to the information +source. + """ + __slots__ = ('_path_helper', '_extmethods', '__credibility_preference','__logical_network_element','__network_instance','__topology',) + + _yang_name = 'information-source-state' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__credibility_preference = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="credibility-preference", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=False) + self.__logical_network_element = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="logical-network-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + self.__network_instance = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + self.__topology = YANGDynClass(base=topology.topology, is_container='container', yang_name="topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'information-source-state'] + + def _get_credibility_preference(self): + """ + Getter method for credibility_preference, mapped from YANG variable /networks/network/node/te/information_source_entry/information_source_state/credibility_preference (uint16) + + YANG Description: The preference value for calculating the Traffic +Engineering database credibility value used for +tie-break selection between different information-source +values. A higher value is preferable. + """ + return self.__credibility_preference + + def _set_credibility_preference(self, v, load=False): + """ + Setter method for credibility_preference, mapped from YANG variable /networks/network/node/te/information_source_entry/information_source_state/credibility_preference (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_credibility_preference is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_credibility_preference() directly. + + YANG Description: The preference value for calculating the Traffic +Engineering database credibility value used for +tie-break selection between different information-source +values. A higher value is preferable. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="credibility-preference", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """credibility_preference must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="credibility-preference", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=False)""", + }) + + self.__credibility_preference = t + if hasattr(self, '_set'): + self._set() + + def _unset_credibility_preference(self): + self.__credibility_preference = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="credibility-preference", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=False) + + + def _get_logical_network_element(self): + """ + Getter method for logical_network_element, mapped from YANG variable /networks/network/node/te/information_source_entry/information_source_state/logical_network_element (string) + + YANG Description: When applicable, this is the name of a logical network +element from which the information is learned. + """ + return self.__logical_network_element + + def _set_logical_network_element(self, v, load=False): + """ + Setter method for logical_network_element, mapped from YANG variable /networks/network/node/te/information_source_entry/information_source_state/logical_network_element (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_logical_network_element is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_logical_network_element() directly. + + YANG Description: When applicable, this is the name of a logical network +element from which the information is learned. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="logical-network-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """logical_network_element must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="logical-network-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__logical_network_element = t + if hasattr(self, '_set'): + self._set() + + def _unset_logical_network_element(self): + self.__logical_network_element = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="logical-network-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + + def _get_network_instance(self): + """ + Getter method for network_instance, mapped from YANG variable /networks/network/node/te/information_source_entry/information_source_state/network_instance (string) + + YANG Description: When applicable, this is the name of a network instance +from which the information is learned. + """ + return self.__network_instance + + def _set_network_instance(self, v, load=False): + """ + Setter method for network_instance, mapped from YANG variable /networks/network/node/te/information_source_entry/information_source_state/network_instance (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_instance is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_instance() directly. + + YANG Description: When applicable, this is the name of a network instance +from which the information is learned. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_instance must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__network_instance = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_instance(self): + self.__network_instance = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + + def _get_topology(self): + """ + Getter method for topology, mapped from YANG variable /networks/network/node/te/information_source_entry/information_source_state/topology (container) + + YANG Description: When the information is processed by the system, +the attributes in this container indicate which topology +is used to generate the result information. + """ + return self.__topology + + def _set_topology(self, v, load=False): + """ + Setter method for topology, mapped from YANG variable /networks/network/node/te/information_source_entry/information_source_state/topology (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_topology is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_topology() directly. + + YANG Description: When the information is processed by the system, +the attributes in this container indicate which topology +is used to generate the result information. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=topology.topology, is_container='container', yang_name="topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """topology must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=topology.topology, is_container='container', yang_name="topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__topology = t + if hasattr(self, '_set'): + self._set() + + def _unset_topology(self): + self.__topology = YANGDynClass(base=topology.topology, is_container='container', yang_name="topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + credibility_preference = __builtin__.property(_get_credibility_preference) + logical_network_element = __builtin__.property(_get_logical_network_element) + network_instance = __builtin__.property(_get_network_instance) + topology = __builtin__.property(_get_topology) + + + _pyangbind_elements = OrderedDict([('credibility_preference', credibility_preference), ('logical_network_element', logical_network_element), ('network_instance', network_instance), ('topology', topology), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/information_source_state/topology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/information_source_state/topology/__init__.py new file mode 100644 index 000000000..5fc5e047b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/information_source_state/topology/__init__.py @@ -0,0 +1,162 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class topology(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/information-source-state/topology. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: When the information is processed by the system, +the attributes in this container indicate which topology +is used to generate the result information. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_ref','__network_ref',) + + _yang_name = 'topology' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="node-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'information-source-state', 'topology'] + + def _get_node_ref(self): + """ + Getter method for node_ref, mapped from YANG variable /networks/network/node/te/information_source_entry/information_source_state/topology/node_ref (leafref) + + YANG Description: Used to reference a node. +Nodes are identified relative to the network that +contains them. + """ + return self.__node_ref + + def _set_node_ref(self, v, load=False): + """ + Setter method for node_ref, mapped from YANG variable /networks/network/node/te/information_source_entry/information_source_state/topology/node_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_ref() directly. + + YANG Description: Used to reference a node. +Nodes are identified relative to the network that +contains them. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="node-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="node-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False)""", + }) + + self.__node_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_ref(self): + self.__node_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="node-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/node/te/information_source_entry/information_source_state/topology/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/node/te/information_source_entry/information_source_state/topology/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + + node_ref = __builtin__.property(_get_node_ref) + network_ref = __builtin__.property(_get_network_ref) + + + _pyangbind_elements = OrderedDict([('node_ref', node_ref), ('network_ref', network_ref), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/underlay_topology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/underlay_topology/__init__.py new file mode 100644 index 000000000..c0d77ce6f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_entry/underlay_topology/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class underlay_topology(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-entry/underlay-topology. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: When an abstract node encapsulates a topology, the +attributes in this container point to said topology. + """ + __slots__ = ('_path_helper', '_extmethods', '__network_ref',) + + _yang_name = 'underlay-topology' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-entry', 'underlay-topology'] + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/node/te/information_source_entry/underlay_topology/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/node/te/information_source_entry/underlay_topology/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + + network_ref = __builtin__.property(_get_network_ref) + + + _pyangbind_elements = OrderedDict([('network_ref', network_ref), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_state/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_state/__init__.py new file mode 100644 index 000000000..7767ff2b6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_state/__init__.py @@ -0,0 +1,248 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import topology +class information_source_state(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-state. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains state attributes related to the information +source. + """ + __slots__ = ('_path_helper', '_extmethods', '__credibility_preference','__logical_network_element','__network_instance','__topology',) + + _yang_name = 'information-source-state' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__credibility_preference = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="credibility-preference", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=False) + self.__logical_network_element = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="logical-network-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + self.__network_instance = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + self.__topology = YANGDynClass(base=topology.topology, is_container='container', yang_name="topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-state'] + + def _get_credibility_preference(self): + """ + Getter method for credibility_preference, mapped from YANG variable /networks/network/node/te/information_source_state/credibility_preference (uint16) + + YANG Description: The preference value for calculating the Traffic +Engineering database credibility value used for +tie-break selection between different information-source +values. A higher value is preferable. + """ + return self.__credibility_preference + + def _set_credibility_preference(self, v, load=False): + """ + Setter method for credibility_preference, mapped from YANG variable /networks/network/node/te/information_source_state/credibility_preference (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_credibility_preference is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_credibility_preference() directly. + + YANG Description: The preference value for calculating the Traffic +Engineering database credibility value used for +tie-break selection between different information-source +values. A higher value is preferable. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="credibility-preference", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """credibility_preference must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="credibility-preference", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=False)""", + }) + + self.__credibility_preference = t + if hasattr(self, '_set'): + self._set() + + def _unset_credibility_preference(self): + self.__credibility_preference = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="credibility-preference", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=False) + + + def _get_logical_network_element(self): + """ + Getter method for logical_network_element, mapped from YANG variable /networks/network/node/te/information_source_state/logical_network_element (string) + + YANG Description: When applicable, this is the name of a logical network +element from which the information is learned. + """ + return self.__logical_network_element + + def _set_logical_network_element(self, v, load=False): + """ + Setter method for logical_network_element, mapped from YANG variable /networks/network/node/te/information_source_state/logical_network_element (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_logical_network_element is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_logical_network_element() directly. + + YANG Description: When applicable, this is the name of a logical network +element from which the information is learned. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="logical-network-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """logical_network_element must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="logical-network-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__logical_network_element = t + if hasattr(self, '_set'): + self._set() + + def _unset_logical_network_element(self): + self.__logical_network_element = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="logical-network-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + + def _get_network_instance(self): + """ + Getter method for network_instance, mapped from YANG variable /networks/network/node/te/information_source_state/network_instance (string) + + YANG Description: When applicable, this is the name of a network instance +from which the information is learned. + """ + return self.__network_instance + + def _set_network_instance(self, v, load=False): + """ + Setter method for network_instance, mapped from YANG variable /networks/network/node/te/information_source_state/network_instance (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_instance is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_instance() directly. + + YANG Description: When applicable, this is the name of a network instance +from which the information is learned. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_instance must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__network_instance = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_instance(self): + self.__network_instance = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-instance", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + + def _get_topology(self): + """ + Getter method for topology, mapped from YANG variable /networks/network/node/te/information_source_state/topology (container) + + YANG Description: When the information is processed by the system, +the attributes in this container indicate which topology +is used to generate the result information. + """ + return self.__topology + + def _set_topology(self, v, load=False): + """ + Setter method for topology, mapped from YANG variable /networks/network/node/te/information_source_state/topology (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_topology is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_topology() directly. + + YANG Description: When the information is processed by the system, +the attributes in this container indicate which topology +is used to generate the result information. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=topology.topology, is_container='container', yang_name="topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """topology must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=topology.topology, is_container='container', yang_name="topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__topology = t + if hasattr(self, '_set'): + self._set() + + def _unset_topology(self): + self.__topology = YANGDynClass(base=topology.topology, is_container='container', yang_name="topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + credibility_preference = __builtin__.property(_get_credibility_preference) + logical_network_element = __builtin__.property(_get_logical_network_element) + network_instance = __builtin__.property(_get_network_instance) + topology = __builtin__.property(_get_topology) + + + _pyangbind_elements = OrderedDict([('credibility_preference', credibility_preference), ('logical_network_element', logical_network_element), ('network_instance', network_instance), ('topology', topology), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_state/topology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_state/topology/__init__.py new file mode 100644 index 000000000..6562d9003 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/information_source_state/topology/__init__.py @@ -0,0 +1,162 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class topology(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/information-source-state/topology. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: When the information is processed by the system, +the attributes in this container indicate which topology +is used to generate the result information. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_ref','__network_ref',) + + _yang_name = 'topology' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="node-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'information-source-state', 'topology'] + + def _get_node_ref(self): + """ + Getter method for node_ref, mapped from YANG variable /networks/network/node/te/information_source_state/topology/node_ref (leafref) + + YANG Description: Used to reference a node. +Nodes are identified relative to the network that +contains them. + """ + return self.__node_ref + + def _set_node_ref(self, v, load=False): + """ + Setter method for node_ref, mapped from YANG variable /networks/network/node/te/information_source_state/topology/node_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_ref() directly. + + YANG Description: Used to reference a node. +Nodes are identified relative to the network that +contains them. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="node-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="node-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False)""", + }) + + self.__node_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_ref(self): + self.__node_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="node-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/node/te/information_source_state/topology/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/node/te/information_source_state/topology/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=False) + + node_ref = __builtin__.property(_get_node_ref) + network_ref = __builtin__.property(_get_network_ref) + + + _pyangbind_elements = OrderedDict([('node_ref', node_ref), ('network_ref', network_ref), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/statistics/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/statistics/__init__.py new file mode 100644 index 000000000..6741fb0fd --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/statistics/__init__.py @@ -0,0 +1,207 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import node +from . import connectivity_matrix_entry +class statistics(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/statistics. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Statistics data. + """ + __slots__ = ('_path_helper', '_extmethods', '__discontinuity_time','__node','__connectivity_matrix_entry',) + + _yang_name = 'statistics' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__discontinuity_time = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[\\+\\-]\\d{2}:\\d{2})'}), is_leaf=True, yang_name="discontinuity-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:date-and-time', is_config=False) + self.__node = YANGDynClass(base=node.node, is_container='container', yang_name="node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__connectivity_matrix_entry = YANGDynClass(base=connectivity_matrix_entry.connectivity_matrix_entry, is_container='container', yang_name="connectivity-matrix-entry", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'statistics'] + + def _get_discontinuity_time(self): + """ + Getter method for discontinuity_time, mapped from YANG variable /networks/network/node/te/statistics/discontinuity_time (yang:date-and-time) + + YANG Description: The time of the most recent occasion at which any one or +more of this interface's counters suffered a +discontinuity. If no such discontinuities have occurred +since the last re-initialization of the local management +subsystem, then this node contains the time the local +management subsystem re-initialized itself. + """ + return self.__discontinuity_time + + def _set_discontinuity_time(self, v, load=False): + """ + Setter method for discontinuity_time, mapped from YANG variable /networks/network/node/te/statistics/discontinuity_time (yang:date-and-time) + If this variable is read-only (config: false) in the + source YANG file, then _set_discontinuity_time is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_discontinuity_time() directly. + + YANG Description: The time of the most recent occasion at which any one or +more of this interface's counters suffered a +discontinuity. If no such discontinuities have occurred +since the last re-initialization of the local management +subsystem, then this node contains the time the local +management subsystem re-initialized itself. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[\\+\\-]\\d{2}:\\d{2})'}), is_leaf=True, yang_name="discontinuity-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:date-and-time', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """discontinuity_time must be of a type compatible with yang:date-and-time""", + 'defined-type': "yang:date-and-time", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[\\+\\-]\\d{2}:\\d{2})'}), is_leaf=True, yang_name="discontinuity-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:date-and-time', is_config=False)""", + }) + + self.__discontinuity_time = t + if hasattr(self, '_set'): + self._set() + + def _unset_discontinuity_time(self): + self.__discontinuity_time = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[\\+\\-]\\d{2}:\\d{2})'}), is_leaf=True, yang_name="discontinuity-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:date-and-time', is_config=False) + + + def _get_node(self): + """ + Getter method for node, mapped from YANG variable /networks/network/node/te/statistics/node (container) + + YANG Description: Contains statistics attributes at the TE node level. + """ + return self.__node + + def _set_node(self, v, load=False): + """ + Setter method for node, mapped from YANG variable /networks/network/node/te/statistics/node (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_node is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node() directly. + + YANG Description: Contains statistics attributes at the TE node level. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=node.node, is_container='container', yang_name="node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=node.node, is_container='container', yang_name="node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__node = t + if hasattr(self, '_set'): + self._set() + + def _unset_node(self): + self.__node = YANGDynClass(base=node.node, is_container='container', yang_name="node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_connectivity_matrix_entry(self): + """ + Getter method for connectivity_matrix_entry, mapped from YANG variable /networks/network/node/te/statistics/connectivity_matrix_entry (container) + + YANG Description: Contains statistics attributes at the level of a +connectivity matrix entry. + """ + return self.__connectivity_matrix_entry + + def _set_connectivity_matrix_entry(self, v, load=False): + """ + Setter method for connectivity_matrix_entry, mapped from YANG variable /networks/network/node/te/statistics/connectivity_matrix_entry (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_connectivity_matrix_entry is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_connectivity_matrix_entry() directly. + + YANG Description: Contains statistics attributes at the level of a +connectivity matrix entry. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=connectivity_matrix_entry.connectivity_matrix_entry, is_container='container', yang_name="connectivity-matrix-entry", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """connectivity_matrix_entry must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=connectivity_matrix_entry.connectivity_matrix_entry, is_container='container', yang_name="connectivity-matrix-entry", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__connectivity_matrix_entry = t + if hasattr(self, '_set'): + self._set() + + def _unset_connectivity_matrix_entry(self): + self.__connectivity_matrix_entry = YANGDynClass(base=connectivity_matrix_entry.connectivity_matrix_entry, is_container='container', yang_name="connectivity-matrix-entry", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + discontinuity_time = __builtin__.property(_get_discontinuity_time) + node = __builtin__.property(_get_node) + connectivity_matrix_entry = __builtin__.property(_get_connectivity_matrix_entry) + + + _pyangbind_elements = OrderedDict([('discontinuity_time', discontinuity_time), ('node', node), ('connectivity_matrix_entry', connectivity_matrix_entry), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/statistics/connectivity_matrix_entry/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/statistics/connectivity_matrix_entry/__init__.py new file mode 100644 index 000000000..7c96f28c4 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/statistics/connectivity_matrix_entry/__init__.py @@ -0,0 +1,282 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class connectivity_matrix_entry(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/statistics/connectivity-matrix-entry. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains statistics attributes at the level of a +connectivity matrix entry. + """ + __slots__ = ('_path_helper', '_extmethods', '__creates','__deletes','__disables','__enables','__modifies',) + + _yang_name = 'connectivity-matrix-entry' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__creates = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="creates", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__deletes = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="deletes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__disables = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="disables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__enables = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="enables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__modifies = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="modifies", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'statistics', 'connectivity-matrix-entry'] + + def _get_creates(self): + """ + Getter method for creates, mapped from YANG variable /networks/network/node/te/statistics/connectivity_matrix_entry/creates (yang:counter32) + + YANG Description: Number of times that a connectivity matrix entry was +created. + """ + return self.__creates + + def _set_creates(self, v, load=False): + """ + Setter method for creates, mapped from YANG variable /networks/network/node/te/statistics/connectivity_matrix_entry/creates (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_creates is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_creates() directly. + + YANG Description: Number of times that a connectivity matrix entry was +created. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="creates", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """creates must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="creates", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__creates = t + if hasattr(self, '_set'): + self._set() + + def _unset_creates(self): + self.__creates = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="creates", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_deletes(self): + """ + Getter method for deletes, mapped from YANG variable /networks/network/node/te/statistics/connectivity_matrix_entry/deletes (yang:counter32) + + YANG Description: Number of times that a connectivity matrix entry was +deleted. + """ + return self.__deletes + + def _set_deletes(self, v, load=False): + """ + Setter method for deletes, mapped from YANG variable /networks/network/node/te/statistics/connectivity_matrix_entry/deletes (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_deletes is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_deletes() directly. + + YANG Description: Number of times that a connectivity matrix entry was +deleted. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="deletes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """deletes must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="deletes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__deletes = t + if hasattr(self, '_set'): + self._set() + + def _unset_deletes(self): + self.__deletes = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="deletes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_disables(self): + """ + Getter method for disables, mapped from YANG variable /networks/network/node/te/statistics/connectivity_matrix_entry/disables (yang:counter32) + + YANG Description: Number of times that a connectivity matrix entry was +disabled. + """ + return self.__disables + + def _set_disables(self, v, load=False): + """ + Setter method for disables, mapped from YANG variable /networks/network/node/te/statistics/connectivity_matrix_entry/disables (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_disables is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_disables() directly. + + YANG Description: Number of times that a connectivity matrix entry was +disabled. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="disables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """disables must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="disables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__disables = t + if hasattr(self, '_set'): + self._set() + + def _unset_disables(self): + self.__disables = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="disables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_enables(self): + """ + Getter method for enables, mapped from YANG variable /networks/network/node/te/statistics/connectivity_matrix_entry/enables (yang:counter32) + + YANG Description: Number of times that a connectivity matrix entry was +enabled. + """ + return self.__enables + + def _set_enables(self, v, load=False): + """ + Setter method for enables, mapped from YANG variable /networks/network/node/te/statistics/connectivity_matrix_entry/enables (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_enables is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_enables() directly. + + YANG Description: Number of times that a connectivity matrix entry was +enabled. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="enables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """enables must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="enables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__enables = t + if hasattr(self, '_set'): + self._set() + + def _unset_enables(self): + self.__enables = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="enables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_modifies(self): + """ + Getter method for modifies, mapped from YANG variable /networks/network/node/te/statistics/connectivity_matrix_entry/modifies (yang:counter32) + + YANG Description: Number of times that a connectivity matrix entry was +modified. + """ + return self.__modifies + + def _set_modifies(self, v, load=False): + """ + Setter method for modifies, mapped from YANG variable /networks/network/node/te/statistics/connectivity_matrix_entry/modifies (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_modifies is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_modifies() directly. + + YANG Description: Number of times that a connectivity matrix entry was +modified. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="modifies", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """modifies must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="modifies", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__modifies = t + if hasattr(self, '_set'): + self._set() + + def _unset_modifies(self): + self.__modifies = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="modifies", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + creates = __builtin__.property(_get_creates) + deletes = __builtin__.property(_get_deletes) + disables = __builtin__.property(_get_disables) + enables = __builtin__.property(_get_enables) + modifies = __builtin__.property(_get_modifies) + + + _pyangbind_elements = OrderedDict([('creates', creates), ('deletes', deletes), ('disables', disables), ('enables', enables), ('modifies', modifies), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/statistics/node/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/statistics/node/__init__.py new file mode 100644 index 000000000..4d1e11b5e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/statistics/node/__init__.py @@ -0,0 +1,273 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class node(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/statistics/node. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains statistics attributes at the TE node level. + """ + __slots__ = ('_path_helper', '_extmethods', '__disables','__enables','__maintenance_sets','__maintenance_clears','__modifies',) + + _yang_name = 'node' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__disables = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="disables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__enables = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="enables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__maintenance_sets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="maintenance-sets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__maintenance_clears = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="maintenance-clears", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__modifies = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="modifies", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'statistics', 'node'] + + def _get_disables(self): + """ + Getter method for disables, mapped from YANG variable /networks/network/node/te/statistics/node/disables (yang:counter32) + + YANG Description: Number of times that a node was disabled. + """ + return self.__disables + + def _set_disables(self, v, load=False): + """ + Setter method for disables, mapped from YANG variable /networks/network/node/te/statistics/node/disables (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_disables is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_disables() directly. + + YANG Description: Number of times that a node was disabled. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="disables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """disables must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="disables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__disables = t + if hasattr(self, '_set'): + self._set() + + def _unset_disables(self): + self.__disables = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="disables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_enables(self): + """ + Getter method for enables, mapped from YANG variable /networks/network/node/te/statistics/node/enables (yang:counter32) + + YANG Description: Number of times that a node was enabled. + """ + return self.__enables + + def _set_enables(self, v, load=False): + """ + Setter method for enables, mapped from YANG variable /networks/network/node/te/statistics/node/enables (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_enables is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_enables() directly. + + YANG Description: Number of times that a node was enabled. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="enables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """enables must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="enables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__enables = t + if hasattr(self, '_set'): + self._set() + + def _unset_enables(self): + self.__enables = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="enables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_maintenance_sets(self): + """ + Getter method for maintenance_sets, mapped from YANG variable /networks/network/node/te/statistics/node/maintenance_sets (yang:counter32) + + YANG Description: Number of times that a node was put in maintenance. + """ + return self.__maintenance_sets + + def _set_maintenance_sets(self, v, load=False): + """ + Setter method for maintenance_sets, mapped from YANG variable /networks/network/node/te/statistics/node/maintenance_sets (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_maintenance_sets is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_maintenance_sets() directly. + + YANG Description: Number of times that a node was put in maintenance. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="maintenance-sets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """maintenance_sets must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="maintenance-sets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__maintenance_sets = t + if hasattr(self, '_set'): + self._set() + + def _unset_maintenance_sets(self): + self.__maintenance_sets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="maintenance-sets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_maintenance_clears(self): + """ + Getter method for maintenance_clears, mapped from YANG variable /networks/network/node/te/statistics/node/maintenance_clears (yang:counter32) + + YANG Description: Number of times that a node was taken out of +maintenance. + """ + return self.__maintenance_clears + + def _set_maintenance_clears(self, v, load=False): + """ + Setter method for maintenance_clears, mapped from YANG variable /networks/network/node/te/statistics/node/maintenance_clears (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_maintenance_clears is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_maintenance_clears() directly. + + YANG Description: Number of times that a node was taken out of +maintenance. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="maintenance-clears", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """maintenance_clears must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="maintenance-clears", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__maintenance_clears = t + if hasattr(self, '_set'): + self._set() + + def _unset_maintenance_clears(self): + self.__maintenance_clears = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="maintenance-clears", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_modifies(self): + """ + Getter method for modifies, mapped from YANG variable /networks/network/node/te/statistics/node/modifies (yang:counter32) + + YANG Description: Number of times that a node was modified. + """ + return self.__modifies + + def _set_modifies(self, v, load=False): + """ + Setter method for modifies, mapped from YANG variable /networks/network/node/te/statistics/node/modifies (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_modifies is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_modifies() directly. + + YANG Description: Number of times that a node was modified. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="modifies", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """modifies must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="modifies", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__modifies = t + if hasattr(self, '_set'): + self._set() + + def _unset_modifies(self): + self.__modifies = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="modifies", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + disables = __builtin__.property(_get_disables) + enables = __builtin__.property(_get_enables) + maintenance_sets = __builtin__.property(_get_maintenance_sets) + maintenance_clears = __builtin__.property(_get_maintenance_clears) + modifies = __builtin__.property(_get_modifies) + + + _pyangbind_elements = OrderedDict([('disables', disables), ('enables', enables), ('maintenance_sets', maintenance_sets), ('maintenance_clears', maintenance_clears), ('modifies', modifies), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/__init__.py new file mode 100644 index 000000000..08e7f93be --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/__init__.py @@ -0,0 +1,357 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import connectivity_matrices +from . import underlay_topology +class te_node_attributes(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains node attributes in a TE topology. + """ + __slots__ = ('_path_helper', '_extmethods', '__admin_status','__connectivity_matrices','__domain_id','__is_abstract','__name','__signaling_address','__underlay_topology',) + + _yang_name = 'te-node-attributes' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__admin_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True) + self.__connectivity_matrices = YANGDynClass(base=connectivity_matrices.connectivity_matrices, is_container='container', yang_name="connectivity-matrices", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__domain_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="domain-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__is_abstract = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-abstract", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=True) + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + self.__signaling_address = YANGDynClass(unique=True, base=TypedListType(allowed_type=[RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),]), is_leaf=False, yang_name="signaling-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:ip-address', is_config=True) + self.__underlay_topology = YANGDynClass(base=underlay_topology.underlay_topology, is_container='container', yang_name="underlay-topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes'] + + def _get_admin_status(self): + """ + Getter method for admin_status, mapped from YANG variable /networks/network/node/te/te_node_attributes/admin_status (te-types:te-admin-status) + + YANG Description: The administrative state of the link. + """ + return self.__admin_status + + def _set_admin_status(self, v, load=False): + """ + Setter method for admin_status, mapped from YANG variable /networks/network/node/te/te_node_attributes/admin_status (te-types:te-admin-status) + If this variable is read-only (config: false) in the + source YANG file, then _set_admin_status is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_admin_status() directly. + + YANG Description: The administrative state of the link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """admin_status must be of a type compatible with te-types:te-admin-status""", + 'defined-type': "te-types:te-admin-status", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True)""", + }) + + self.__admin_status = t + if hasattr(self, '_set'): + self._set() + + def _unset_admin_status(self): + self.__admin_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True) + + + def _get_connectivity_matrices(self): + """ + Getter method for connectivity_matrices, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices (container) + + YANG Description: Contains a connectivity matrix on a TE node. + """ + return self.__connectivity_matrices + + def _set_connectivity_matrices(self, v, load=False): + """ + Setter method for connectivity_matrices, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_connectivity_matrices is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_connectivity_matrices() directly. + + YANG Description: Contains a connectivity matrix on a TE node. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=connectivity_matrices.connectivity_matrices, is_container='container', yang_name="connectivity-matrices", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """connectivity_matrices must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=connectivity_matrices.connectivity_matrices, is_container='container', yang_name="connectivity-matrices", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__connectivity_matrices = t + if hasattr(self, '_set'): + self._set() + + def _unset_connectivity_matrices(self): + self.__connectivity_matrices = YANGDynClass(base=connectivity_matrices.connectivity_matrices, is_container='container', yang_name="connectivity-matrices", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_domain_id(self): + """ + Getter method for domain_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/domain_id (uint32) + + YANG Description: Identifies the domain to which this node belongs. +This attribute is used to support inter-domain links. + """ + return self.__domain_id + + def _set_domain_id(self, v, load=False): + """ + Setter method for domain_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/domain_id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_domain_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_domain_id() directly. + + YANG Description: Identifies the domain to which this node belongs. +This attribute is used to support inter-domain links. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="domain-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """domain_id must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="domain-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__domain_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_domain_id(self): + self.__domain_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="domain-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_is_abstract(self): + """ + Getter method for is_abstract, mapped from YANG variable /networks/network/node/te/te_node_attributes/is_abstract (empty) + + YANG Description: Present if the node is abstract; not present if the node +is actual. + """ + return self.__is_abstract + + def _set_is_abstract(self, v, load=False): + """ + Setter method for is_abstract, mapped from YANG variable /networks/network/node/te/te_node_attributes/is_abstract (empty) + If this variable is read-only (config: false) in the + source YANG file, then _set_is_abstract is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_is_abstract() directly. + + YANG Description: Present if the node is abstract; not present if the node +is actual. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="is-abstract", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """is_abstract must be of a type compatible with empty""", + 'defined-type': "empty", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-abstract", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=True)""", + }) + + self.__is_abstract = t + if hasattr(self, '_set'): + self._set() + + def _unset_is_abstract(self): + self.__is_abstract = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-abstract", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=True) + + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /networks/network/node/te/te_node_attributes/name (string) + + YANG Description: Node name. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /networks/network/node/te/te_node_attributes/name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: Node name. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + + def _get_signaling_address(self): + """ + Getter method for signaling_address, mapped from YANG variable /networks/network/node/te/te_node_attributes/signaling_address (inet:ip-address) + + YANG Description: The node's signaling address. + """ + return self.__signaling_address + + def _set_signaling_address(self, v, load=False): + """ + Setter method for signaling_address, mapped from YANG variable /networks/network/node/te/te_node_attributes/signaling_address (inet:ip-address) + If this variable is read-only (config: false) in the + source YANG file, then _set_signaling_address is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_signaling_address() directly. + + YANG Description: The node's signaling address. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=[RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),]), is_leaf=False, yang_name="signaling-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:ip-address', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """signaling_address must be of a type compatible with inet:ip-address""", + 'defined-type': "inet:ip-address", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=[RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),]), is_leaf=False, yang_name="signaling-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:ip-address', is_config=True)""", + }) + + self.__signaling_address = t + if hasattr(self, '_set'): + self._set() + + def _unset_signaling_address(self): + self.__signaling_address = YANGDynClass(unique=True, base=TypedListType(allowed_type=[RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),]), is_leaf=False, yang_name="signaling-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:ip-address', is_config=True) + + + def _get_underlay_topology(self): + """ + Getter method for underlay_topology, mapped from YANG variable /networks/network/node/te/te_node_attributes/underlay_topology (container) + + YANG Description: When an abstract node encapsulates a topology, the +attributes in this container point to said topology. + """ + return self.__underlay_topology + + def _set_underlay_topology(self, v, load=False): + """ + Setter method for underlay_topology, mapped from YANG variable /networks/network/node/te/te_node_attributes/underlay_topology (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_underlay_topology is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_underlay_topology() directly. + + YANG Description: When an abstract node encapsulates a topology, the +attributes in this container point to said topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=underlay_topology.underlay_topology, is_container='container', yang_name="underlay-topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """underlay_topology must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=underlay_topology.underlay_topology, is_container='container', yang_name="underlay-topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__underlay_topology = t + if hasattr(self, '_set'): + self._set() + + def _unset_underlay_topology(self): + self.__underlay_topology = YANGDynClass(base=underlay_topology.underlay_topology, is_container='container', yang_name="underlay-topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + admin_status = __builtin__.property(_get_admin_status, _set_admin_status) + connectivity_matrices = __builtin__.property(_get_connectivity_matrices, _set_connectivity_matrices) + domain_id = __builtin__.property(_get_domain_id, _set_domain_id) + is_abstract = __builtin__.property(_get_is_abstract, _set_is_abstract) + name = __builtin__.property(_get_name, _set_name) + signaling_address = __builtin__.property(_get_signaling_address, _set_signaling_address) + underlay_topology = __builtin__.property(_get_underlay_topology, _set_underlay_topology) + + + _pyangbind_elements = OrderedDict([('admin_status', admin_status), ('connectivity_matrices', connectivity_matrices), ('domain_id', domain_id), ('is_abstract', is_abstract), ('name', name), ('signaling_address', signaling_address), ('underlay_topology', underlay_topology), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/__init__.py new file mode 100644 index 000000000..e1a23ffc8 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/__init__.py @@ -0,0 +1,412 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import label_restrictions +from . import underlay +from . import path_constraints +from . import optimizations +from . import path_properties +from . import connectivity_matrix +class connectivity_matrices(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains a connectivity matrix on a TE node. + """ + __slots__ = ('_path_helper', '_extmethods', '__number_of_entries','__label_restrictions','__is_allowed','__underlay','__path_constraints','__optimizations','__path_properties','__connectivity_matrix',) + + _yang_name = 'connectivity-matrices' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__number_of_entries = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number-of-entries", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=True) + self.__label_restrictions = YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__is_allowed = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + self.__underlay = YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_constraints = YANGDynClass(base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__optimizations = YANGDynClass(base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_properties = YANGDynClass(base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__connectivity_matrix = YANGDynClass(base=YANGListType("id",connectivity_matrix.connectivity_matrix, yang_name="connectivity-matrix", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='id', extensions=None), is_container='list', yang_name="connectivity-matrix", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices'] + + def _get_number_of_entries(self): + """ + Getter method for number_of_entries, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/number_of_entries (uint16) + + YANG Description: The number of connectivity matrix entries. +If this number is specified in the configuration request, +the number is the requested number of entries, which may +not all be listed in the list; +if this number is reported in the state data, +the number is the current number of operational entries. + """ + return self.__number_of_entries + + def _set_number_of_entries(self, v, load=False): + """ + Setter method for number_of_entries, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/number_of_entries (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_number_of_entries is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_number_of_entries() directly. + + YANG Description: The number of connectivity matrix entries. +If this number is specified in the configuration request, +the number is the requested number of entries, which may +not all be listed in the list; +if this number is reported in the state data, +the number is the current number of operational entries. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number-of-entries", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """number_of_entries must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number-of-entries", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=True)""", + }) + + self.__number_of_entries = t + if hasattr(self, '_set'): + self._set() + + def _unset_number_of_entries(self): + self.__number_of_entries = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number-of-entries", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=True) + + + def _get_label_restrictions(self): + """ + Getter method for label_restrictions, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions (container) + + YANG Description: The label restrictions container. + """ + return self.__label_restrictions + + def _set_label_restrictions(self, v, load=False): + """ + Setter method for label_restrictions, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_restrictions is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_restrictions() directly. + + YANG Description: The label restrictions container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_restrictions must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_restrictions = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_restrictions(self): + self.__label_restrictions = YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_is_allowed(self): + """ + Getter method for is_allowed, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/is_allowed (boolean) + + YANG Description: 'true' - switching is allowed; +'false' - switching is disallowed. + """ + return self.__is_allowed + + def _set_is_allowed(self, v, load=False): + """ + Setter method for is_allowed, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/is_allowed (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_is_allowed is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_is_allowed() directly. + + YANG Description: 'true' - switching is allowed; +'false' - switching is disallowed. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """is_allowed must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__is_allowed = t + if hasattr(self, '_set'): + self._set() + + def _unset_is_allowed(self): + self.__is_allowed = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + + def _get_underlay(self): + """ + Getter method for underlay, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay (container) + + YANG Description: Attributes of the TE link underlay. + """ + return self.__underlay + + def _set_underlay(self, v, load=False): + """ + Setter method for underlay, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_underlay is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_underlay() directly. + + YANG Description: Attributes of the TE link underlay. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """underlay must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__underlay = t + if hasattr(self, '_set'): + self._set() + + def _unset_underlay(self): + self.__underlay = YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_constraints(self): + """ + Getter method for path_constraints, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints (container) + + YANG Description: TE named path constraints container. + """ + return self.__path_constraints + + def _set_path_constraints(self, v, load=False): + """ + Setter method for path_constraints, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_constraints is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_constraints() directly. + + YANG Description: TE named path constraints container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_constraints must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_constraints = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_constraints(self): + self.__path_constraints = YANGDynClass(base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_optimizations(self): + """ + Getter method for optimizations, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations (container) + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + return self.__optimizations + + def _set_optimizations(self, v, load=False): + """ + Setter method for optimizations, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_optimizations is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_optimizations() directly. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """optimizations must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__optimizations = t + if hasattr(self, '_set'): + self._set() + + def _unset_optimizations(self): + self.__optimizations = YANGDynClass(base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_properties(self): + """ + Getter method for path_properties, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties (container) + + YANG Description: The TE path properties. + """ + return self.__path_properties + + def _set_path_properties(self, v, load=False): + """ + Setter method for path_properties, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_properties is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_properties() directly. + + YANG Description: The TE path properties. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_properties must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_properties = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_properties(self): + self.__path_properties = YANGDynClass(base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_connectivity_matrix(self): + """ + Getter method for connectivity_matrix, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix (list) + + YANG Description: Represents a node's switching limitations, i.e., +limitations in the interconnecting network TE links +across the node. + """ + return self.__connectivity_matrix + + def _set_connectivity_matrix(self, v, load=False): + """ + Setter method for connectivity_matrix, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_connectivity_matrix is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_connectivity_matrix() directly. + + YANG Description: Represents a node's switching limitations, i.e., +limitations in the interconnecting network TE links +across the node. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("id",connectivity_matrix.connectivity_matrix, yang_name="connectivity-matrix", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='id', extensions=None), is_container='list', yang_name="connectivity-matrix", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """connectivity_matrix must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("id",connectivity_matrix.connectivity_matrix, yang_name="connectivity-matrix", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='id', extensions=None), is_container='list', yang_name="connectivity-matrix", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__connectivity_matrix = t + if hasattr(self, '_set'): + self._set() + + def _unset_connectivity_matrix(self): + self.__connectivity_matrix = YANGDynClass(base=YANGListType("id",connectivity_matrix.connectivity_matrix, yang_name="connectivity-matrix", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='id', extensions=None), is_container='list', yang_name="connectivity-matrix", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + number_of_entries = __builtin__.property(_get_number_of_entries, _set_number_of_entries) + label_restrictions = __builtin__.property(_get_label_restrictions, _set_label_restrictions) + is_allowed = __builtin__.property(_get_is_allowed, _set_is_allowed) + underlay = __builtin__.property(_get_underlay, _set_underlay) + path_constraints = __builtin__.property(_get_path_constraints, _set_path_constraints) + optimizations = __builtin__.property(_get_optimizations, _set_optimizations) + path_properties = __builtin__.property(_get_path_properties) + connectivity_matrix = __builtin__.property(_get_connectivity_matrix, _set_connectivity_matrix) + + + _pyangbind_elements = OrderedDict([('number_of_entries', number_of_entries), ('label_restrictions', label_restrictions), ('is_allowed', is_allowed), ('underlay', underlay), ('path_constraints', path_constraints), ('optimizations', optimizations), ('path_properties', path_properties), ('connectivity_matrix', connectivity_matrix), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/__init__.py new file mode 100644 index 000000000..704040fa4 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/__init__.py @@ -0,0 +1,405 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import from_ +from . import to +from . import underlay +from . import path_constraints +from . import optimizations +from . import path_properties +class connectivity_matrix(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Represents a node's switching limitations, i.e., +limitations in the interconnecting network TE links +across the node. + """ + __slots__ = ('_path_helper', '_extmethods', '__id','__from_','__to','__is_allowed','__underlay','__path_constraints','__optimizations','__path_properties',) + + _yang_name = 'connectivity-matrix' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__from_ = YANGDynClass(base=from_.from_, is_container='container', yang_name="from", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__to = YANGDynClass(base=to.to, is_container='container', yang_name="to", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__is_allowed = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + self.__underlay = YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_constraints = YANGDynClass(base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__optimizations = YANGDynClass(base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_properties = YANGDynClass(base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix'] + + def _get_id(self): + """ + Getter method for id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/id (uint32) + + YANG Description: Identifies the connectivity matrix entry. + """ + return self.__id + + def _set_id(self, v, load=False): + """ + Setter method for id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_id() directly. + + YANG Description: Identifies the connectivity matrix entry. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """id must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__id = t + if hasattr(self, '_set'): + self._set() + + def _unset_id(self): + self.__id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_from_(self): + """ + Getter method for from_, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from (container) + + YANG Description: Reference to a source LTP. + """ + return self.__from_ + + def _set_from_(self, v, load=False): + """ + Setter method for from_, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_from_ is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_from_() directly. + + YANG Description: Reference to a source LTP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=from_.from_, is_container='container', yang_name="from", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """from_ must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=from_.from_, is_container='container', yang_name="from", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__from_ = t + if hasattr(self, '_set'): + self._set() + + def _unset_from_(self): + self.__from_ = YANGDynClass(base=from_.from_, is_container='container', yang_name="from", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_to(self): + """ + Getter method for to, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to (container) + + YANG Description: Reference to a destination LTP. + """ + return self.__to + + def _set_to(self, v, load=False): + """ + Setter method for to, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_to is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_to() directly. + + YANG Description: Reference to a destination LTP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=to.to, is_container='container', yang_name="to", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """to must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=to.to, is_container='container', yang_name="to", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__to = t + if hasattr(self, '_set'): + self._set() + + def _unset_to(self): + self.__to = YANGDynClass(base=to.to, is_container='container', yang_name="to", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_is_allowed(self): + """ + Getter method for is_allowed, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/is_allowed (boolean) + + YANG Description: 'true' - switching is allowed; +'false' - switching is disallowed. + """ + return self.__is_allowed + + def _set_is_allowed(self, v, load=False): + """ + Setter method for is_allowed, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/is_allowed (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_is_allowed is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_is_allowed() directly. + + YANG Description: 'true' - switching is allowed; +'false' - switching is disallowed. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """is_allowed must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__is_allowed = t + if hasattr(self, '_set'): + self._set() + + def _unset_is_allowed(self): + self.__is_allowed = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + + def _get_underlay(self): + """ + Getter method for underlay, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay (container) + + YANG Description: Attributes of the TE link underlay. + """ + return self.__underlay + + def _set_underlay(self, v, load=False): + """ + Setter method for underlay, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_underlay is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_underlay() directly. + + YANG Description: Attributes of the TE link underlay. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """underlay must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__underlay = t + if hasattr(self, '_set'): + self._set() + + def _unset_underlay(self): + self.__underlay = YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_constraints(self): + """ + Getter method for path_constraints, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints (container) + + YANG Description: TE named path constraints container. + """ + return self.__path_constraints + + def _set_path_constraints(self, v, load=False): + """ + Setter method for path_constraints, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_constraints is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_constraints() directly. + + YANG Description: TE named path constraints container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_constraints must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_constraints = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_constraints(self): + self.__path_constraints = YANGDynClass(base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_optimizations(self): + """ + Getter method for optimizations, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations (container) + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + return self.__optimizations + + def _set_optimizations(self, v, load=False): + """ + Setter method for optimizations, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_optimizations is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_optimizations() directly. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """optimizations must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__optimizations = t + if hasattr(self, '_set'): + self._set() + + def _unset_optimizations(self): + self.__optimizations = YANGDynClass(base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_properties(self): + """ + Getter method for path_properties, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties (container) + + YANG Description: The TE path properties. + """ + return self.__path_properties + + def _set_path_properties(self, v, load=False): + """ + Setter method for path_properties, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_properties is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_properties() directly. + + YANG Description: The TE path properties. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_properties must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_properties = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_properties(self): + self.__path_properties = YANGDynClass(base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + id = __builtin__.property(_get_id, _set_id) + from_ = __builtin__.property(_get_from_, _set_from_) + to = __builtin__.property(_get_to, _set_to) + is_allowed = __builtin__.property(_get_is_allowed, _set_is_allowed) + underlay = __builtin__.property(_get_underlay, _set_underlay) + path_constraints = __builtin__.property(_get_path_constraints, _set_path_constraints) + optimizations = __builtin__.property(_get_optimizations, _set_optimizations) + path_properties = __builtin__.property(_get_path_properties) + + + _pyangbind_elements = OrderedDict([('id', id), ('from_', from_), ('to', to), ('is_allowed', is_allowed), ('underlay', underlay), ('path_constraints', path_constraints), ('optimizations', optimizations), ('path_properties', path_properties), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/__init__.py new file mode 100644 index 000000000..40157c904 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/__init__.py @@ -0,0 +1,155 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import label_restrictions +class from_(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/from. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Reference to a source LTP. + """ + __slots__ = ('_path_helper', '_extmethods', '__tp_ref','__label_restrictions',) + + _yang_name = 'from' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tp_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + self.__label_restrictions = YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'from'] + + def _get_tp_ref(self): + """ + Getter method for tp_ref, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/tp_ref (leafref) + + YANG Description: Relative reference to a termination point. + """ + return self.__tp_ref + + def _set_tp_ref(self, v, load=False): + """ + Setter method for tp_ref, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/tp_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tp_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tp_ref() directly. + + YANG Description: Relative reference to a termination point. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tp_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__tp_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_tp_ref(self): + self.__tp_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + + def _get_label_restrictions(self): + """ + Getter method for label_restrictions, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions (container) + + YANG Description: The label restrictions container. + """ + return self.__label_restrictions + + def _set_label_restrictions(self, v, load=False): + """ + Setter method for label_restrictions, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_restrictions is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_restrictions() directly. + + YANG Description: The label restrictions container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_restrictions must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_restrictions = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_restrictions(self): + self.__label_restrictions = YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + tp_ref = __builtin__.property(_get_tp_ref, _set_tp_ref) + label_restrictions = __builtin__.property(_get_label_restrictions, _set_label_restrictions) + + + _pyangbind_elements = OrderedDict([('tp_ref', tp_ref), ('label_restrictions', label_restrictions), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/__init__.py new file mode 100644 index 000000000..5a441f8e0 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/__init__.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import label_restriction +class label_restrictions(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/from/label-restrictions. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The label restrictions container. + """ + __slots__ = ('_path_helper', '_extmethods', '__label_restriction',) + + _yang_name = 'label-restrictions' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__label_restriction = YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions'] + + def _get_label_restriction(self): + """ + Getter method for label_restriction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction (list) + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + return self.__label_restriction + + def _set_label_restriction(self, v, load=False): + """ + Setter method for label_restriction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_restriction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_restriction() directly. + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_restriction must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__label_restriction = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_restriction(self): + self.__label_restriction = YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + label_restriction = __builtin__.property(_get_label_restriction, _set_label_restriction) + + + _pyangbind_elements = OrderedDict([('label_restriction', label_restriction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/__init__.py new file mode 100644 index 000000000..be63791cb --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/__init__.py @@ -0,0 +1,450 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import label_start +from . import label_end +from . import label_step +from . import otn_label_range +from . import ethernet_label_range +class label_restriction(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/from/label-restrictions/label-restriction. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + __slots__ = ('_path_helper', '_extmethods', '__restriction','__index','__label_start','__label_end','__label_step','__range_bitmap','__otn_label_range','__ethernet_label_range',) + + _yang_name = 'label-restriction' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__restriction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__label_start = YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_end = YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_step = YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__range_bitmap = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True) + self.__otn_label_range = YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__ethernet_label_range = YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions', 'label-restriction'] + + def _get_restriction(self): + """ + Getter method for restriction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/restriction (enumeration) + + YANG Description: Indicates whether the list item is inclusive or exclusive. + """ + return self.__restriction + + def _set_restriction(self, v, load=False): + """ + Setter method for restriction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/restriction (enumeration) + If this variable is read-only (config: false) in the + source YANG file, then _set_restriction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_restriction() directly. + + YANG Description: Indicates whether the list item is inclusive or exclusive. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """restriction must be of a type compatible with enumeration""", + 'defined-type': "ietf-te-topology:enumeration", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True)""", + }) + + self.__restriction = t + if hasattr(self, '_set'): + self._set() + + def _unset_restriction(self): + self.__restriction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/index (uint32) + + YANG Description: The index of the label restriction list entry. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/index (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: The index of the label restriction list entry. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_label_start(self): + """ + Getter method for label_start, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start (container) + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + return self.__label_start + + def _set_label_start(self, v, load=False): + """ + Setter method for label_start, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_start is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_start() directly. + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_start must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_start = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_start(self): + self.__label_start = YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_end(self): + """ + Getter method for label_end, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end (container) + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + return self.__label_end + + def _set_label_end(self, v, load=False): + """ + Setter method for label_end, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_end is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_end() directly. + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_end must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_end = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_end(self): + self.__label_end = YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_step(self): + """ + Getter method for label_step, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step (container) + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + return self.__label_step + + def _set_label_step(self, v, load=False): + """ + Setter method for label_step, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_step is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_step() directly. + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_step must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_step = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_step(self): + self.__label_step = YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_range_bitmap(self): + """ + Getter method for range_bitmap, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/range_bitmap (yang:hex-string) + + YANG Description: When there are gaps between 'label-start' and 'label-end', +this attribute is used to specify the positions +of the used labels. This is represented in big endian as +'hex-string'. +The most significant byte in the hex-string is the farthest +to the left in the byte sequence. Leading zero bytes in the +configured value may be omitted for brevity. +Each bit position in the 'range-bitmap' 'hex-string' maps +to a label in the range derived from 'label-start'. + +For example, assuming that 'label-start' = 16000 and +'range-bitmap' = 0x01000001, then: + +- bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. +- bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1. + """ + return self.__range_bitmap + + def _set_range_bitmap(self, v, load=False): + """ + Setter method for range_bitmap, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/range_bitmap (yang:hex-string) + If this variable is read-only (config: false) in the + source YANG file, then _set_range_bitmap is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_range_bitmap() directly. + + YANG Description: When there are gaps between 'label-start' and 'label-end', +this attribute is used to specify the positions +of the used labels. This is represented in big endian as +'hex-string'. +The most significant byte in the hex-string is the farthest +to the left in the byte sequence. Leading zero bytes in the +configured value may be omitted for brevity. +Each bit position in the 'range-bitmap' 'hex-string' maps +to a label in the range derived from 'label-start'. + +For example, assuming that 'label-start' = 16000 and +'range-bitmap' = 0x01000001, then: + +- bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. +- bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """range_bitmap must be of a type compatible with yang:hex-string""", + 'defined-type': "yang:hex-string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True)""", + }) + + self.__range_bitmap = t + if hasattr(self, '_set'): + self._set() + + def _unset_range_bitmap(self): + self.__range_bitmap = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True) + + + def _get_otn_label_range(self): + """ + Getter method for otn_label_range, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/otn_label_range (container) + + YANG Description: Label range information for OTN. + """ + return self.__otn_label_range + + def _set_otn_label_range(self, v, load=False): + """ + Setter method for otn_label_range, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/otn_label_range (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn_label_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn_label_range() directly. + + YANG Description: Label range information for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn_label_range must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn_label_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn_label_range(self): + self.__otn_label_range = YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_ethernet_label_range(self): + """ + Getter method for ethernet_label_range, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/ethernet_label_range (container) + + YANG Description: Ethernet-specific label range related information. + """ + return self.__ethernet_label_range + + def _set_ethernet_label_range(self, v, load=False): + """ + Setter method for ethernet_label_range, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/ethernet_label_range (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_ethernet_label_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ethernet_label_range() directly. + + YANG Description: Ethernet-specific label range related information. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ethernet_label_range must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True)""", + }) + + self.__ethernet_label_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_ethernet_label_range(self): + self.__ethernet_label_range = YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + restriction = __builtin__.property(_get_restriction, _set_restriction) + index = __builtin__.property(_get_index, _set_index) + label_start = __builtin__.property(_get_label_start, _set_label_start) + label_end = __builtin__.property(_get_label_end, _set_label_end) + label_step = __builtin__.property(_get_label_step, _set_label_step) + range_bitmap = __builtin__.property(_get_range_bitmap, _set_range_bitmap) + otn_label_range = __builtin__.property(_get_otn_label_range, _set_otn_label_range) + ethernet_label_range = __builtin__.property(_get_ethernet_label_range, _set_ethernet_label_range) + + + _pyangbind_elements = OrderedDict([('restriction', restriction), ('index', index), ('label_start', label_start), ('label_end', label_end), ('label_step', label_step), ('range_bitmap', range_bitmap), ('otn_label_range', otn_label_range), ('ethernet_label_range', ethernet_label_range), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/ethernet_label_range/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/ethernet_label_range/__init__.py new file mode 100644 index 000000000..85fe797a5 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/ethernet_label_range/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class ethernet_label_range(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/from/label-restrictions/label-restriction/ethernet-label-range. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Ethernet-specific label range related information. + """ + __slots__ = ('_path_helper', '_extmethods', '__tag_type','__priority',) + + _yang_name = 'ethernet-label-range' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tag_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions', 'label-restriction', 'ethernet-label-range'] + + def _get_tag_type(self): + """ + Getter method for tag_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/ethernet_label_range/tag_type (etht-types:eth-tag-type) + + YANG Description: VLAN tag type. + """ + return self.__tag_type + + def _set_tag_type(self, v, load=False): + """ + Setter method for tag_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/ethernet_label_range/tag_type (etht-types:eth-tag-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_tag_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tag_type() directly. + + YANG Description: VLAN tag type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tag_type must be of a type compatible with etht-types:eth-tag-type""", + 'defined-type': "etht-types:eth-tag-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True)""", + }) + + self.__tag_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_tag_type(self): + self.__tag_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/ethernet_label_range/priority (uint8) + + YANG Description: priority. + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/ethernet_label_range/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: priority. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True) + + tag_type = __builtin__.property(_get_tag_type, _set_tag_type) + priority = __builtin__.property(_get_priority, _set_priority) + + + _pyangbind_elements = OrderedDict([('tag_type', tag_type), ('priority', priority), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_end/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_end/__init__.py new file mode 100644 index 000000000..3d944dc6d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_end/__init__.py @@ -0,0 +1,119 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_end(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/from/label-restrictions/label-restriction/label-end. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-end' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions', 'label-restriction', 'label-end'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_end/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_end/te_label/__init__.py new file mode 100644 index 000000000..c0f426a02 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_end/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/from/label-restrictions/label-restriction/label-end/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions', 'label-restriction', 'label-end', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/otn (container) + + YANG Description: Label start or label end for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label start or label end for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py new file mode 100644 index 000000000..252392100 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/from/label-restrictions/label-restriction/label-end/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label start or label end for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions', 'label-restriction', 'label-end', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/otn/ts (otn-ts) + + YANG Description: Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_end/te_label/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + ts = __builtin__.property(_get_ts, _set_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_start/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_start/__init__.py new file mode 100644 index 000000000..7233908c1 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_start/__init__.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_start(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/from/label-restrictions/label-restriction/label-start. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-start' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions', 'label-restriction', 'label-start'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_start/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_start/te_label/__init__.py new file mode 100644 index 000000000..c15cb8c1b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_start/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/from/label-restrictions/label-restriction/label-start/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions', 'label-restriction', 'label-start', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/otn (container) + + YANG Description: Label start or label end for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label start or label end for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py new file mode 100644 index 000000000..29741fa5e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/from/label-restrictions/label-restriction/label-start/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label start or label end for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions', 'label-restriction', 'label-start', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/otn/ts (otn-ts) + + YANG Description: Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_start/te_label/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + ts = __builtin__.property(_get_ts, _set_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_step/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_step/__init__.py new file mode 100644 index 000000000..076a06d96 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_step/__init__.py @@ -0,0 +1,200 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class label_step(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/from/label-restrictions/label-restriction/label-step. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_step',) + + _yang_name = 'label-step' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__eth_step = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions', 'label-restriction', 'label-step'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/generic (int32) + + YANG Description: Label range step. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/generic (int32) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Label range step. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with int32""", + 'defined-type': "int32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/otn (container) + + YANG Description: Label step for OTN + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label step for OTN + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_eth_step(self): + """ + Getter method for eth_step, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/eth_step (uint16) + + YANG Description: Label step which represent possible increments for +an Ethernet VLAN tag. + """ + return self.__eth_step + + def _set_eth_step(self, v, load=False): + """ + Setter method for eth_step, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/eth_step (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_step is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_step() directly. + + YANG Description: Label step which represent possible increments for +an Ethernet VLAN tag. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_step must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True)""", + }) + + self.__eth_step = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_step(self): + self.__eth_step = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + eth_step = __builtin__.property(_get_eth_step, _set_eth_step) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['eth_step']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_step', eth_step), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_step/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_step/otn/__init__.py new file mode 100644 index 000000000..023f3d755 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/label_step/otn/__init__.py @@ -0,0 +1,158 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/from/label-restrictions/label-restriction/label-step/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label step for OTN + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions', 'label-restriction', 'label-step', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/otn/tpn (otn-tpn) + + YANG Description: Label step which represents possible increments for +Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Label step which represents possible increments for +Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/otn/ts (otn-ts) + + YANG Description: Label step which represents possible increments for +Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/label_step/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Label step which represents possible increments for +Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + ts = __builtin__.property(_get_ts, _set_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/otn_label_range/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/otn_label_range/__init__.py new file mode 100644 index 000000000..9e9f6bb66 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from_/label_restrictions/label_restriction/otn_label_range/__init__.py @@ -0,0 +1,256 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn_label_range(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/from/label-restrictions/label-restriction/otn-label-range. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label range information for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__range_type','__tsg','__odu_type_list','__priority',) + + _yang_name = 'otn-label-range' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__range_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__odu_type_list = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'from', 'label-restrictions', 'label-restriction', 'otn-label-range'] + + def _get_range_type(self): + """ + Getter method for range_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/otn_label_range/range_type (otn-label-range-type) + + YANG Description: The type of range (e.g., TPN or TS) +to which the label range applies + """ + return self.__range_type + + def _set_range_type(self, v, load=False): + """ + Setter method for range_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/otn_label_range/range_type (otn-label-range-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_range_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_range_type() directly. + + YANG Description: The type of range (e.g., TPN or TS) +to which the label range applies + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """range_type must be of a type compatible with otn-label-range-type""", + 'defined-type': "ietf-otn-topology:otn-label-range-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True)""", + }) + + self.__range_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_range_type(self): + self.__range_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/otn_label_range/tsg (identityref) + + YANG Description: Tributary slot granularity (TSG) to which the label range +applies. + +This leaf MUST be present when the range-type is TS. + +This leaf MAY be omitted when mapping an ODUk over an OTUk +Link. In this case the range-type is tpn, with only one +entry (ODUk), and the tpn range has only one value (1). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/otn_label_range/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary slot granularity (TSG) to which the label range +applies. + +This leaf MUST be present when the range-type is TS. + +This leaf MAY be omitted when mapping an ODUk over an OTUk +Link. In this case the range-type is tpn, with only one +entry (ODUk), and the tpn range has only one value (1). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_odu_type_list(self): + """ + Getter method for odu_type_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/otn_label_range/odu_type_list (identityref) + + YANG Description: List of ODU types to which the label range applies. + +An Empty odu-type-list means that the label range +applies to all the supported ODU types. + """ + return self.__odu_type_list + + def _set_odu_type_list(self, v, load=False): + """ + Setter method for odu_type_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/otn_label_range/odu_type_list (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type_list() directly. + + YANG Description: List of ODU types to which the label range applies. + +An Empty odu-type-list means that the label range +applies to all the supported ODU types. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type_list must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__odu_type_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type_list(self): + self.__odu_type_list = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/otn_label_range/priority (uint8) + + YANG Description: Priority in Interface Switching Capability +Descriptor (ISCD). + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/from/label_restrictions/label_restriction/otn_label_range/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: Priority in Interface Switching Capability +Descriptor (ISCD). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True) + + range_type = __builtin__.property(_get_range_type, _set_range_type) + tsg = __builtin__.property(_get_tsg, _set_tsg) + odu_type_list = __builtin__.property(_get_odu_type_list, _set_odu_type_list) + priority = __builtin__.property(_get_priority, _set_priority) + + + _pyangbind_elements = OrderedDict([('range_type', range_type), ('tsg', tsg), ('odu_type_list', odu_type_list), ('priority', priority), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/__init__.py new file mode 100644 index 000000000..dccc4ecbe --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/__init__.py @@ -0,0 +1,199 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import optimization_metric +from . import tiebreakers +from . import objective_function +class optimizations(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + __slots__ = ('_path_helper', '_extmethods', '__optimization_metric','__tiebreakers','__objective_function',) + + _yang_name = 'optimizations' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__optimization_metric = YANGDynClass(base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + self.__tiebreakers = YANGDynClass(base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__objective_function = YANGDynClass(base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations'] + + def _get_optimization_metric(self): + """ + Getter method for optimization_metric, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric (list) + + YANG Description: TE path metric type. + """ + return self.__optimization_metric + + def _set_optimization_metric(self, v, load=False): + """ + Setter method for optimization_metric, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_optimization_metric is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_optimization_metric() directly. + + YANG Description: TE path metric type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """optimization_metric must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__optimization_metric = t + if hasattr(self, '_set'): + self._set() + + def _unset_optimization_metric(self): + self.__optimization_metric = YANGDynClass(base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + + def _get_tiebreakers(self): + """ + Getter method for tiebreakers, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers (container) + + YANG Description: Container for the list of tiebreakers. + """ + return self.__tiebreakers + + def _set_tiebreakers(self, v, load=False): + """ + Setter method for tiebreakers, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tiebreakers is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tiebreakers() directly. + + YANG Description: Container for the list of tiebreakers. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tiebreakers must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__tiebreakers = t + if hasattr(self, '_set'): + self._set() + + def _unset_tiebreakers(self): + self.__tiebreakers = YANGDynClass(base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_objective_function(self): + """ + Getter method for objective_function, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/objective_function (container) + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + return self.__objective_function + + def _set_objective_function(self, v, load=False): + """ + Setter method for objective_function, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/objective_function (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_objective_function is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_objective_function() directly. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """objective_function must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__objective_function = t + if hasattr(self, '_set'): + self._set() + + def _unset_objective_function(self): + self.__objective_function = YANGDynClass(base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + optimization_metric = __builtin__.property(_get_optimization_metric, _set_optimization_metric) + tiebreakers = __builtin__.property(_get_tiebreakers, _set_tiebreakers) + objective_function = __builtin__.property(_get_objective_function, _set_objective_function) + + __choices__ = {'algorithm': {'metric': ['optimization_metric', 'tiebreakers'], 'objective-function': ['objective_function']}} + _pyangbind_elements = OrderedDict([('optimization_metric', optimization_metric), ('tiebreakers', tiebreakers), ('objective_function', objective_function), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/objective_function/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/objective_function/__init__.py new file mode 100644 index 000000000..dd970e56f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/objective_function/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class objective_function(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/objective-function. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + __slots__ = ('_path_helper', '_extmethods', '__objective_function_type',) + + _yang_name = 'objective-function' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__objective_function_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'objective-function'] + + def _get_objective_function_type(self): + """ + Getter method for objective_function_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/objective_function/objective_function_type (identityref) + + YANG Description: Objective function entry. + """ + return self.__objective_function_type + + def _set_objective_function_type(self, v, load=False): + """ + Setter method for objective_function_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/objective_function/objective_function_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_objective_function_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_objective_function_type() directly. + + YANG Description: Objective function entry. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """objective_function_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__objective_function_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_objective_function_type(self): + self.__objective_function_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + objective_function_type = __builtin__.property(_get_objective_function_type, _set_objective_function_type) + + __choices__ = {'algorithm': {'objective-function': ['objective_function_type']}} + _pyangbind_elements = OrderedDict([('objective_function_type', objective_function_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/__init__.py new file mode 100644 index 000000000..63bedfaf5 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/__init__.py @@ -0,0 +1,241 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import explicit_route_exclude_objects +from . import explicit_route_include_objects +class optimization_metric(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE path metric type. + """ + __slots__ = ('_path_helper', '_extmethods', '__metric_type','__weight','__explicit_route_exclude_objects','__explicit_route_include_objects',) + + _yang_name = 'optimization-metric' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__weight = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + self.__explicit_route_exclude_objects = YANGDynClass(base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__explicit_route_include_objects = YANGDynClass(base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric'] + + def _get_metric_type(self): + """ + Getter method for metric_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/metric_type (identityref) + + YANG Description: Identifies the 'metric-type' that the path computation +process uses for optimization. + """ + return self.__metric_type + + def _set_metric_type(self, v, load=False): + """ + Setter method for metric_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/metric_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_metric_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_metric_type() directly. + + YANG Description: Identifies the 'metric-type' that the path computation +process uses for optimization. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """metric_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__metric_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_metric_type(self): + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_weight(self): + """ + Getter method for weight, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/weight (uint8) + + YANG Description: TE path metric normalization weight. + """ + return self.__weight + + def _set_weight(self, v, load=False): + """ + Setter method for weight, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/weight (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_weight is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_weight() directly. + + YANG Description: TE path metric normalization weight. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """weight must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__weight = t + if hasattr(self, '_set'): + self._set() + + def _unset_weight(self): + self.__weight = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + + + def _get_explicit_route_exclude_objects(self): + """ + Getter method for explicit_route_exclude_objects, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects (container) + + YANG Description: Container for the 'exclude route' object list. + """ + return self.__explicit_route_exclude_objects + + def _set_explicit_route_exclude_objects(self, v, load=False): + """ + Setter method for explicit_route_exclude_objects, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_explicit_route_exclude_objects is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_explicit_route_exclude_objects() directly. + + YANG Description: Container for the 'exclude route' object list. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """explicit_route_exclude_objects must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__explicit_route_exclude_objects = t + if hasattr(self, '_set'): + self._set() + + def _unset_explicit_route_exclude_objects(self): + self.__explicit_route_exclude_objects = YANGDynClass(base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_explicit_route_include_objects(self): + """ + Getter method for explicit_route_include_objects, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects (container) + + YANG Description: Container for the 'include route' object list. + """ + return self.__explicit_route_include_objects + + def _set_explicit_route_include_objects(self, v, load=False): + """ + Setter method for explicit_route_include_objects, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_explicit_route_include_objects is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_explicit_route_include_objects() directly. + + YANG Description: Container for the 'include route' object list. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """explicit_route_include_objects must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__explicit_route_include_objects = t + if hasattr(self, '_set'): + self._set() + + def _unset_explicit_route_include_objects(self): + self.__explicit_route_include_objects = YANGDynClass(base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + metric_type = __builtin__.property(_get_metric_type, _set_metric_type) + weight = __builtin__.property(_get_weight, _set_weight) + explicit_route_exclude_objects = __builtin__.property(_get_explicit_route_exclude_objects, _set_explicit_route_exclude_objects) + explicit_route_include_objects = __builtin__.property(_get_explicit_route_include_objects, _set_explicit_route_include_objects) + + __choices__ = {'algorithm': {'metric': ['metric_type', 'weight', 'explicit_route_exclude_objects', 'explicit_route_include_objects']}} + _pyangbind_elements = OrderedDict([('metric_type', metric_type), ('weight', weight), ('explicit_route_exclude_objects', explicit_route_exclude_objects), ('explicit_route_include_objects', explicit_route_include_objects), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/__init__.py new file mode 100644 index 000000000..07c1656b9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import route_object_exclude_object +class explicit_route_exclude_objects(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-exclude-objects. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the 'exclude route' object list. + """ + __slots__ = ('_path_helper', '_extmethods', '__route_object_exclude_object',) + + _yang_name = 'explicit-route-exclude-objects' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__route_object_exclude_object = YANGDynClass(base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects'] + + def _get_route_object_exclude_object(self): + """ + Getter method for route_object_exclude_object, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object (list) + + YANG Description: List of Explicit Route Objects to be excluded in the +path computation. + """ + return self.__route_object_exclude_object + + def _set_route_object_exclude_object(self, v, load=False): + """ + Setter method for route_object_exclude_object, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_route_object_exclude_object is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_route_object_exclude_object() directly. + + YANG Description: List of Explicit Route Objects to be excluded in the +path computation. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """route_object_exclude_object must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__route_object_exclude_object = t + if hasattr(self, '_set'): + self._set() + + def _unset_route_object_exclude_object(self): + self.__route_object_exclude_object = YANGDynClass(base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + route_object_exclude_object = __builtin__.property(_get_route_object_exclude_object, _set_route_object_exclude_object) + + __choices__ = {'algorithm': {'metric': ['route_object_exclude_object']}} + _pyangbind_elements = OrderedDict([('route_object_exclude_object', route_object_exclude_object), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py new file mode 100644 index 000000000..4a4f8fd0f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py @@ -0,0 +1,365 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +from . import srlg +class route_object_exclude_object(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of Explicit Route Objects to be excluded in the +path computation. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop','__srlg',) + + _yang_name = 'route-object-exclude-object' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__srlg = YANGDynClass(base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/index (uint32) + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/index (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_srlg(self): + """ + Getter method for srlg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg (container) + + YANG Description: SRLG container. + """ + return self.__srlg + + def _set_srlg(self, v, load=False): + """ + Setter method for srlg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_srlg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_srlg() directly. + + YANG Description: SRLG container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """srlg must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__srlg = t + if hasattr(self, '_set'): + self._set() + + def _unset_srlg(self): + self.__srlg = YANGDynClass(base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + index = __builtin__.property(_get_index, _set_index) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop, _set_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop, _set_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop, _set_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop, _set_as_number_hop) + label_hop = __builtin__.property(_get_label_hop, _set_label_hop) + srlg = __builtin__.property(_get_srlg, _set_srlg) + + __choices__ = {'algorithm': {'metric': ['index']}, 'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop'], 'srlg': ['srlg']}} + _pyangbind_elements = OrderedDict([('index', index), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ('srlg', srlg), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/__init__.py new file mode 100644 index 000000000..783159e57 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + as_number = __builtin__.property(_get_as_number, _set_as_number) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/__init__.py new file mode 100644 index 000000000..484b23ab1 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/__init__.py new file mode 100644 index 000000000..6b55fb421 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/__init__.py new file mode 100644 index 000000000..f11e3324c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + tsg = __builtin__.property(_get_tsg, _set_tsg) + ts_list = __builtin__.property(_get_ts_list, _set_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/__init__.py new file mode 100644 index 000000000..80a217af8 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/__init__.py new file mode 100644 index 000000000..694b6a3c1 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/__init__.py new file mode 100644 index 000000000..9a858772e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/__init__.py @@ -0,0 +1,115 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class srlg(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/srlg. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: SRLG container. + """ + __slots__ = ('_path_helper', '_extmethods', '__srlg',) + + _yang_name = 'srlg' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__srlg = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'srlg'] + + def _get_srlg(self): + """ + Getter method for srlg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/srlg (uint32) + + YANG Description: SRLG value. + """ + return self.__srlg + + def _set_srlg(self, v, load=False): + """ + Setter method for srlg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/srlg (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_srlg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_srlg() directly. + + YANG Description: SRLG value. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """srlg must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__srlg = t + if hasattr(self, '_set'): + self._set() + + def _unset_srlg(self): + self.__srlg = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + srlg = __builtin__.property(_get_srlg, _set_srlg) + + __choices__ = {'type': {'srlg': ['srlg']}} + _pyangbind_elements = OrderedDict([('srlg', srlg), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/__init__.py new file mode 100644 index 000000000..4a0e2b21e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/__init__.py new file mode 100644 index 000000000..cea85916d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import route_object_include_object +class explicit_route_include_objects(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-include-objects. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the 'include route' object list. + """ + __slots__ = ('_path_helper', '_extmethods', '__route_object_include_object',) + + _yang_name = 'explicit-route-include-objects' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__route_object_include_object = YANGDynClass(base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-include-objects'] + + def _get_route_object_include_object(self): + """ + Getter method for route_object_include_object, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object (list) + + YANG Description: List of Explicit Route Objects to be included in the +path computation. + """ + return self.__route_object_include_object + + def _set_route_object_include_object(self, v, load=False): + """ + Setter method for route_object_include_object, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_route_object_include_object is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_route_object_include_object() directly. + + YANG Description: List of Explicit Route Objects to be included in the +path computation. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """route_object_include_object must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__route_object_include_object = t + if hasattr(self, '_set'): + self._set() + + def _unset_route_object_include_object(self): + self.__route_object_include_object = YANGDynClass(base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + route_object_include_object = __builtin__.property(_get_route_object_include_object, _set_route_object_include_object) + + __choices__ = {'algorithm': {'metric': ['route_object_include_object']}} + _pyangbind_elements = OrderedDict([('route_object_include_object', route_object_include_object), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py new file mode 100644 index 000000000..1330f425e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py @@ -0,0 +1,325 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class route_object_include_object(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of Explicit Route Objects to be included in the +path computation. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'route-object-include-object' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/index (uint32) + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/index (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + index = __builtin__.property(_get_index, _set_index) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop, _set_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop, _set_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop, _set_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop, _set_as_number_hop) + label_hop = __builtin__.property(_get_label_hop, _set_label_hop) + + __choices__ = {'algorithm': {'metric': ['index']}, 'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('index', index), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/__init__.py new file mode 100644 index 000000000..edcea596e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + as_number = __builtin__.property(_get_as_number, _set_as_number) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/__init__.py new file mode 100644 index 000000000..20d876129 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/__init__.py new file mode 100644 index 000000000..2f3c37938 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/__init__.py new file mode 100644 index 000000000..d9361ab75 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + tsg = __builtin__.property(_get_tsg, _set_tsg) + ts_list = __builtin__.property(_get_ts_list, _set_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/__init__.py new file mode 100644 index 000000000..e53b4266d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/__init__.py new file mode 100644 index 000000000..f49e95c2a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/__init__.py new file mode 100644 index 000000000..f69f0f6b7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers/__init__.py new file mode 100644 index 000000000..e0333aee2 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers/__init__.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import tiebreaker +class tiebreakers(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/tiebreakers. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of tiebreakers. + """ + __slots__ = ('_path_helper', '_extmethods', '__tiebreaker',) + + _yang_name = 'tiebreakers' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tiebreaker = YANGDynClass(base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'tiebreakers'] + + def _get_tiebreaker(self): + """ + Getter method for tiebreaker, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers/tiebreaker (list) + + YANG Description: The list of tiebreaker criteria to apply on an +equally favored set of paths, in order to pick +the best. + """ + return self.__tiebreaker + + def _set_tiebreaker(self, v, load=False): + """ + Setter method for tiebreaker, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers/tiebreaker (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_tiebreaker is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tiebreaker() directly. + + YANG Description: The list of tiebreaker criteria to apply on an +equally favored set of paths, in order to pick +the best. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tiebreaker must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__tiebreaker = t + if hasattr(self, '_set'): + self._set() + + def _unset_tiebreaker(self): + self.__tiebreaker = YANGDynClass(base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + tiebreaker = __builtin__.property(_get_tiebreaker, _set_tiebreaker) + + __choices__ = {'algorithm': {'metric': ['tiebreaker']}} + _pyangbind_elements = OrderedDict([('tiebreaker', tiebreaker), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers/tiebreaker/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers/tiebreaker/__init__.py new file mode 100644 index 000000000..26464cef2 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers/tiebreaker/__init__.py @@ -0,0 +1,122 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class tiebreaker(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/optimizations/tiebreakers/tiebreaker. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The list of tiebreaker criteria to apply on an +equally favored set of paths, in order to pick +the best. + """ + __slots__ = ('_path_helper', '_extmethods', '__tiebreaker_type',) + + _yang_name = 'tiebreaker' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tiebreaker_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'optimizations', 'tiebreakers', 'tiebreaker'] + + def _get_tiebreaker_type(self): + """ + Getter method for tiebreaker_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers/tiebreaker/tiebreaker_type (identityref) + + YANG Description: Identifies an entry in the list of tiebreakers. + """ + return self.__tiebreaker_type + + def _set_tiebreaker_type(self, v, load=False): + """ + Setter method for tiebreaker_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/optimizations/tiebreakers/tiebreaker/tiebreaker_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tiebreaker_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tiebreaker_type() directly. + + YANG Description: Identifies an entry in the list of tiebreakers. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tiebreaker_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tiebreaker_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_tiebreaker_type(self): + self.__tiebreaker_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + tiebreaker_type = __builtin__.property(_get_tiebreaker_type, _set_tiebreaker_type) + + __choices__ = {'algorithm': {'metric': ['tiebreaker_type']}} + _pyangbind_elements = OrderedDict([('tiebreaker_type', tiebreaker_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/__init__.py new file mode 100644 index 000000000..2b9f4b692 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/__init__.py @@ -0,0 +1,523 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_bandwidth +from . import path_metric_bounds +from . import path_affinities_values +from . import path_affinity_names +from . import path_srlgs_lists +from . import path_srlgs_names +class path_constraints(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-constraints. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE named path constraints container. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_bandwidth','__link_protection','__setup_priority','__hold_priority','__signaling_type','__path_metric_bounds','__path_affinities_values','__path_affinity_names','__path_srlgs_lists','__path_srlgs_names','__disjointness',) + + _yang_name = 'path-constraints' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__link_protection = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__setup_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + self.__hold_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + self.__signaling_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__path_metric_bounds = YANGDynClass(base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__disjointness = YANGDynClass(base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints'] + + def _get_te_bandwidth(self): + """ + Getter method for te_bandwidth, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth (container) + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + return self.__te_bandwidth + + def _set_te_bandwidth(self, v, load=False): + """ + Setter method for te_bandwidth, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_bandwidth() directly. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_bandwidth(self): + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_link_protection(self): + """ + Getter method for link_protection, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/link_protection (identityref) + + YANG Description: Link protection type required for the links included +in the computed path. + """ + return self.__link_protection + + def _set_link_protection(self, v, load=False): + """ + Setter method for link_protection, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/link_protection (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_protection is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_protection() directly. + + YANG Description: Link protection type required for the links included +in the computed path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_protection must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__link_protection = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_protection(self): + self.__link_protection = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_setup_priority(self): + """ + Getter method for setup_priority, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/setup_priority (uint8) + + YANG Description: TE LSP requested setup priority. + """ + return self.__setup_priority + + def _set_setup_priority(self, v, load=False): + """ + Setter method for setup_priority, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/setup_priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_setup_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_setup_priority() directly. + + YANG Description: TE LSP requested setup priority. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """setup_priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__setup_priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_setup_priority(self): + self.__setup_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + + + def _get_hold_priority(self): + """ + Getter method for hold_priority, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/hold_priority (uint8) + + YANG Description: TE LSP requested hold priority. + """ + return self.__hold_priority + + def _set_hold_priority(self, v, load=False): + """ + Setter method for hold_priority, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/hold_priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_hold_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hold_priority() directly. + + YANG Description: TE LSP requested hold priority. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hold_priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__hold_priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_hold_priority(self): + self.__hold_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + + + def _get_signaling_type(self): + """ + Getter method for signaling_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/signaling_type (identityref) + + YANG Description: TE tunnel path signaling type. + """ + return self.__signaling_type + + def _set_signaling_type(self, v, load=False): + """ + Setter method for signaling_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/signaling_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_signaling_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_signaling_type() directly. + + YANG Description: TE tunnel path signaling type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """signaling_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__signaling_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_signaling_type(self): + self.__signaling_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_path_metric_bounds(self): + """ + Getter method for path_metric_bounds, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds (container) + + YANG Description: TE path metric bounds container. + """ + return self.__path_metric_bounds + + def _set_path_metric_bounds(self, v, load=False): + """ + Setter method for path_metric_bounds, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_metric_bounds is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_metric_bounds() directly. + + YANG Description: TE path metric bounds container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_metric_bounds must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_metric_bounds = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_metric_bounds(self): + self.__path_metric_bounds = YANGDynClass(base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_affinities_values(self): + """ + Getter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values (container) + + YANG Description: Path affinities represented as values. + """ + return self.__path_affinities_values + + def _set_path_affinities_values(self, v, load=False): + """ + Setter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_values() directly. + + YANG Description: Path affinities represented as values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_values must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_affinities_values = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_values(self): + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_affinity_names(self): + """ + Getter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names (container) + + YANG Description: Path affinities represented as names. + """ + return self.__path_affinity_names + + def _set_path_affinity_names(self, v, load=False): + """ + Setter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_names() directly. + + YANG Description: Path affinities represented as names. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_affinity_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_names(self): + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_srlgs_lists(self): + """ + Getter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists (container) + + YANG Description: Path SRLG properties container. + """ + return self.__path_srlgs_lists + + def _set_path_srlgs_lists(self, v, load=False): + """ + Setter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_lists is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_lists() directly. + + YANG Description: Path SRLG properties container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_lists must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_srlgs_lists = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_lists(self): + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_srlgs_names(self): + """ + Getter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names (container) + + YANG Description: Container for the list of named SRLGs. + """ + return self.__path_srlgs_names + + def _set_path_srlgs_names(self, v, load=False): + """ + Setter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_names() directly. + + YANG Description: Container for the list of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_srlgs_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_names(self): + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_disjointness(self): + """ + Getter method for disjointness, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/disjointness (te-path-disjointness) + + YANG Description: The type of resource disjointness. +When configured for a primary path, the disjointness level +applies to all secondary LSPs. When configured for a +secondary path, the disjointness level overrides the level +configured for the primary path. + """ + return self.__disjointness + + def _set_disjointness(self, v, load=False): + """ + Setter method for disjointness, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/disjointness (te-path-disjointness) + If this variable is read-only (config: false) in the + source YANG file, then _set_disjointness is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_disjointness() directly. + + YANG Description: The type of resource disjointness. +When configured for a primary path, the disjointness level +applies to all secondary LSPs. When configured for a +secondary path, the disjointness level overrides the level +configured for the primary path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """disjointness must be of a type compatible with te-path-disjointness""", + 'defined-type': "ietf-te-topology:te-path-disjointness", + 'generated-type': """YANGDynClass(base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', is_config=True)""", + }) + + self.__disjointness = t + if hasattr(self, '_set'): + self._set() + + def _unset_disjointness(self): + self.__disjointness = YANGDynClass(base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', is_config=True) + + te_bandwidth = __builtin__.property(_get_te_bandwidth, _set_te_bandwidth) + link_protection = __builtin__.property(_get_link_protection, _set_link_protection) + setup_priority = __builtin__.property(_get_setup_priority, _set_setup_priority) + hold_priority = __builtin__.property(_get_hold_priority, _set_hold_priority) + signaling_type = __builtin__.property(_get_signaling_type, _set_signaling_type) + path_metric_bounds = __builtin__.property(_get_path_metric_bounds, _set_path_metric_bounds) + path_affinities_values = __builtin__.property(_get_path_affinities_values, _set_path_affinities_values) + path_affinity_names = __builtin__.property(_get_path_affinity_names, _set_path_affinity_names) + path_srlgs_lists = __builtin__.property(_get_path_srlgs_lists, _set_path_srlgs_lists) + path_srlgs_names = __builtin__.property(_get_path_srlgs_names, _set_path_srlgs_names) + disjointness = __builtin__.property(_get_disjointness, _set_disjointness) + + + _pyangbind_elements = OrderedDict([('te_bandwidth', te_bandwidth), ('link_protection', link_protection), ('setup_priority', setup_priority), ('hold_priority', hold_priority), ('signaling_type', signaling_type), ('path_metric_bounds', path_metric_bounds), ('path_affinities_values', path_affinities_values), ('path_affinity_names', path_affinity_names), ('path_srlgs_lists', path_srlgs_lists), ('path_srlgs_names', path_srlgs_names), ('disjointness', disjointness), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/__init__.py new file mode 100644 index 000000000..fbd5be189 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_affinities_value +class path_affinities_values(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-constraints/path-affinities-values. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as values. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinities_value',) + + _yang_name = 'path-affinities-values' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'path-affinities-values'] + + def _get_path_affinities_value(self): + """ + Getter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinities_value + + def _set_path_affinities_value(self, v, load=False): + """ + Setter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_value() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_value must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_affinities_value = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_value(self): + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + path_affinities_value = __builtin__.property(_get_path_affinities_value, _set_path_affinities_value) + + + _pyangbind_elements = OrderedDict([('path_affinities_value', path_affinities_value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value/__init__.py new file mode 100644 index 000000000..8c29e7d9c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value/__init__.py @@ -0,0 +1,161 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_affinities_value(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-constraints/path-affinities-values/path-affinities-value. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__value',) + + _yang_name = 'path-affinities-value' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'path-affinities-values', 'path-affinities-value'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value/usage (identityref) + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_value(self): + """ + Getter method for value, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value/value (admin-groups) + + YANG Description: The affinity value. The default is empty. + """ + return self.__value + + def _set_value(self, v, load=False): + """ + Setter method for value, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinities_values/path_affinities_value/value (admin-groups) + If this variable is read-only (config: false) in the + source YANG file, then _set_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_value() directly. + + YANG Description: The affinity value. The default is empty. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """value must be of a type compatible with admin-groups""", + 'defined-type': "ietf-te-topology:admin-groups", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=True)""", + }) + + self.__value = t + if hasattr(self, '_set'): + self._set() + + def _unset_value(self): + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=True) + + usage = __builtin__.property(_get_usage, _set_usage) + value = __builtin__.property(_get_value, _set_value) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('value', value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/__init__.py new file mode 100644 index 000000000..a8540d0a4 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_affinity_name +class path_affinity_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-constraints/path-affinity-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as names. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinity_name',) + + _yang_name = 'path-affinity-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'path-affinity-names'] + + def _get_path_affinity_name(self): + """ + Getter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinity_name + + def _set_path_affinity_name(self, v, load=False): + """ + Setter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_name() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_name(self): + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + path_affinity_name = __builtin__.property(_get_path_affinity_name, _set_path_affinity_name) + + + _pyangbind_elements = OrderedDict([('path_affinity_name', path_affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/__init__.py new file mode 100644 index 000000000..53d581fd6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/__init__.py @@ -0,0 +1,162 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import affinity_name +class path_affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-constraints/path-affinity-names/path-affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__affinity_name',) + + _yang_name = 'path-affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'path-affinity-names', 'path-affinity-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/usage (identityref) + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_affinity_name(self): + """ + Getter method for affinity_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/affinity_name (list) + + YANG Description: List of named affinities. + """ + return self.__affinity_name + + def _set_affinity_name(self, v, load=False): + """ + Setter method for affinity_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_affinity_name() directly. + + YANG Description: List of named affinities. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_affinity_name(self): + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + usage = __builtin__.property(_get_usage, _set_usage) + affinity_name = __builtin__.property(_get_affinity_name, _set_affinity_name) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('affinity_name', affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py new file mode 100644 index 000000000..9049a1390 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-constraints/path-affinity-names/path-affinity-name/affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinities. + """ + __slots__ = ('_path_helper', '_extmethods', '__name',) + + _yang_name = 'affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'path-affinity-names', 'path-affinity-name', 'affinity-name'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/affinity_name/name (string) + + YANG Description: Identifies a named affinity entry. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_affinity_names/path_affinity_name/affinity_name/name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: Identifies a named affinity entry. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + name = __builtin__.property(_get_name, _set_name) + + + _pyangbind_elements = OrderedDict([('name', name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/__init__.py new file mode 100644 index 000000000..7f6acfbb0 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_metric_bound +class path_metric_bounds(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-constraints/path-metric-bounds. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE path metric bounds container. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_metric_bound',) + + _yang_name = 'path-metric-bounds' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_metric_bound = YANGDynClass(base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'path-metric-bounds'] + + def _get_path_metric_bound(self): + """ + Getter method for path_metric_bound, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound (list) + + YANG Description: List of TE path metric bounds. + """ + return self.__path_metric_bound + + def _set_path_metric_bound(self, v, load=False): + """ + Setter method for path_metric_bound, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_metric_bound is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_metric_bound() directly. + + YANG Description: List of TE path metric bounds. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_metric_bound must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_metric_bound = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_metric_bound(self): + self.__path_metric_bound = YANGDynClass(base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + path_metric_bound = __builtin__.property(_get_path_metric_bound, _set_path_metric_bound) + + + _pyangbind_elements = OrderedDict([('path_metric_bound', path_metric_bound), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound/__init__.py new file mode 100644 index 000000000..177598e6c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound/__init__.py @@ -0,0 +1,165 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_metric_bound(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-constraints/path-metric-bounds/path-metric-bound. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of TE path metric bounds. + """ + __slots__ = ('_path_helper', '_extmethods', '__metric_type','__upper_bound',) + + _yang_name = 'path-metric-bound' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__upper_bound = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'path-metric-bounds', 'path-metric-bound'] + + def _get_metric_type(self): + """ + Getter method for metric_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound/metric_type (identityref) + + YANG Description: Identifies an entry in the list of 'metric-type' items +bound for the TE path. + """ + return self.__metric_type + + def _set_metric_type(self, v, load=False): + """ + Setter method for metric_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound/metric_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_metric_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_metric_type() directly. + + YANG Description: Identifies an entry in the list of 'metric-type' items +bound for the TE path. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """metric_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__metric_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_metric_type(self): + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_upper_bound(self): + """ + Getter method for upper_bound, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound/upper_bound (uint64) + + YANG Description: Upper bound on the end-to-end TE path metric. A zero +indicates an unbounded upper limit for the specific +'metric-type'. + """ + return self.__upper_bound + + def _set_upper_bound(self, v, load=False): + """ + Setter method for upper_bound, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_metric_bounds/path_metric_bound/upper_bound (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_upper_bound is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_upper_bound() directly. + + YANG Description: Upper bound on the end-to-end TE path metric. A zero +indicates an unbounded upper limit for the specific +'metric-type'. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """upper_bound must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__upper_bound = t + if hasattr(self, '_set'): + self._set() + + def _unset_upper_bound(self): + self.__upper_bound = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=True) + + metric_type = __builtin__.property(_get_metric_type, _set_metric_type) + upper_bound = __builtin__.property(_get_upper_bound, _set_upper_bound) + + + _pyangbind_elements = OrderedDict([('metric_type', metric_type), ('upper_bound', upper_bound), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/__init__.py new file mode 100644 index 000000000..9a345c8ae --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_srlgs_list +class path_srlgs_lists(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-constraints/path-srlgs-lists. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path SRLG properties container. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_list',) + + _yang_name = 'path-srlgs-lists' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'path-srlgs-lists'] + + def _get_path_srlgs_list(self): + """ + Getter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list (list) + + YANG Description: List of SRLG values to be included or excluded. + """ + return self.__path_srlgs_list + + def _set_path_srlgs_list(self, v, load=False): + """ + Setter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_list() directly. + + YANG Description: List of SRLG values to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_list must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_srlgs_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_list(self): + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + path_srlgs_list = __builtin__.property(_get_path_srlgs_list, _set_path_srlgs_list) + + + _pyangbind_elements = OrderedDict([('path_srlgs_list', path_srlgs_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py new file mode 100644 index 000000000..42bd453b0 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py @@ -0,0 +1,161 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_srlgs_list(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-constraints/path-srlgs-lists/path-srlgs-list. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of SRLG values to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__values',) + + _yang_name = 'path-srlgs-list' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'path-srlgs-lists', 'path-srlgs-list'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list/usage (identityref) + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_values(self): + """ + Getter method for values, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list/values (srlg) + + YANG Description: List of SRLG values. + """ + return self.__values + + def _set_values(self, v, load=False): + """ + Setter method for values, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_lists/path_srlgs_list/values (srlg) + If this variable is read-only (config: false) in the + source YANG file, then _set_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_values() directly. + + YANG Description: List of SRLG values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """values must be of a type compatible with srlg""", + 'defined-type': "ietf-te-topology:srlg", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=True)""", + }) + + self.__values = t + if hasattr(self, '_set'): + self._set() + + def _unset_values(self): + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=True) + + usage = __builtin__.property(_get_usage, _set_usage) + values = __builtin__.property(_get_values, _set_values) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('values', values), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/__init__.py new file mode 100644 index 000000000..83edd896f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_srlgs_name +class path_srlgs_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-constraints/path-srlgs-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of named SRLGs. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_name',) + + _yang_name = 'path-srlgs-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'path-srlgs-names'] + + def _get_path_srlgs_name(self): + """ + Getter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name (list) + + YANG Description: List of named SRLGs to be included or excluded. + """ + return self.__path_srlgs_name + + def _set_path_srlgs_name(self, v, load=False): + """ + Setter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_name() directly. + + YANG Description: List of named SRLGs to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_srlgs_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_name(self): + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + path_srlgs_name = __builtin__.property(_get_path_srlgs_name, _set_path_srlgs_name) + + + _pyangbind_elements = OrderedDict([('path_srlgs_name', path_srlgs_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py new file mode 100644 index 000000000..7dba34db6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py @@ -0,0 +1,161 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_srlgs_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-constraints/path-srlgs-names/path-srlgs-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named SRLGs to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__names',) + + _yang_name = 'path-srlgs-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'path-srlgs-names', 'path-srlgs-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name/usage (identityref) + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_names(self): + """ + Getter method for names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name/names (string) + + YANG Description: List of named SRLGs. + """ + return self.__names + + def _set_names(self, v, load=False): + """ + Setter method for names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/path_srlgs_names/path_srlgs_name/names (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_names() directly. + + YANG Description: List of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """names must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True)""", + }) + + self.__names = t + if hasattr(self, '_set'): + self._set() + + def _unset_names(self): + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + usage = __builtin__.property(_get_usage, _set_usage) + names = __builtin__.property(_get_names, _set_names) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('names', names), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/__init__.py new file mode 100644 index 000000000..f4e10c8b6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/__init__.py @@ -0,0 +1,195 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-constraints/te-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_bandwidth',) + + _yang_name = 'te-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'te-bandwidth'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/generic (te-bandwidth) + + YANG Description: Bandwidth specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/generic (te-bandwidth) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Bandwidth specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with te-bandwidth""", + 'defined-type': "ietf-te-topology:te-bandwidth", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn (container) + + YANG Description: Bandwidth attributes for OTN links + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Bandwidth attributes for OTN links + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_eth_bandwidth(self): + """ + Getter method for eth_bandwidth, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/eth_bandwidth (uint64) + + YANG Description: Available bandwith value expressed in kilobits per second + """ + return self.__eth_bandwidth + + def _set_eth_bandwidth(self, v, load=False): + """ + Setter method for eth_bandwidth, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/eth_bandwidth (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_bandwidth() directly. + + YANG Description: Available bandwith value expressed in kilobits per second + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_bandwidth must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__eth_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_bandwidth(self): + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + eth_bandwidth = __builtin__.property(_get_eth_bandwidth, _set_eth_bandwidth) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['eth_bandwidth']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_bandwidth', eth_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/__init__.py new file mode 100644 index 000000000..a2a8fce28 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/__init__.py @@ -0,0 +1,163 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import odulist +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-constraints/te-bandwidth/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Bandwidth attributes for OTN links + """ + __slots__ = ('_path_helper', '_extmethods', '__odulist','__odtu_flex_type',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + self.__odtu_flex_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'te-bandwidth', 'otn'] + + def _get_odulist(self): + """ + Getter method for odulist, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist (list) + + YANG Description: OTN bandwidth definition + """ + return self.__odulist + + def _set_odulist(self, v, load=False): + """ + Setter method for odulist, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_odulist is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odulist() directly. + + YANG Description: OTN bandwidth definition + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odulist must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True)""", + }) + + self.__odulist = t + if hasattr(self, '_set'): + self._set() + + def _unset_odulist(self): + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + + + def _get_odtu_flex_type(self): + """ + Getter method for odtu_flex_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odtu_flex_type (l1-types:odtu-flex-type) + + YANG Description: The type of Optical Data Tributary Unit (ODTU) +whose nominal bitrate is used to compute the number of +Tributary Slots (TS) required by the ODUflex LSPs +set up along the underlay path of this OTN +connectivity matrix entry. + """ + return self.__odtu_flex_type + + def _set_odtu_flex_type(self, v, load=False): + """ + Setter method for odtu_flex_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odtu_flex_type (l1-types:odtu-flex-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_odtu_flex_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odtu_flex_type() directly. + + YANG Description: The type of Optical Data Tributary Unit (ODTU) +whose nominal bitrate is used to compute the number of +Tributary Slots (TS) required by the ODUflex LSPs +set up along the underlay path of this OTN +connectivity matrix entry. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odtu_flex_type must be of a type compatible with l1-types:odtu-flex-type""", + 'defined-type': "l1-types:odtu-flex-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True)""", + }) + + self.__odtu_flex_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odtu_flex_type(self): + self.__odtu_flex_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True) + + odulist = __builtin__.property(_get_odulist, _set_odulist) + odtu_flex_type = __builtin__.property(_get_odtu_flex_type, _set_odtu_flex_type) + + __choices__ = {'technology': {'otn': ['odulist', 'odtu_flex_type']}} + _pyangbind_elements = OrderedDict([('odulist', odulist), ('odtu_flex_type', odtu_flex_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist/__init__.py new file mode 100644 index 000000000..9923938e3 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist/__init__.py @@ -0,0 +1,200 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class odulist(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-constraints/te-bandwidth/otn/odulist. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: OTN bandwidth definition + """ + __slots__ = ('_path_helper', '_extmethods', '__odu_type','__number','__ts_number',) + + _yang_name = 'odulist' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-constraints', 'te-bandwidth', 'otn', 'odulist'] + + def _get_odu_type(self): + """ + Getter method for odu_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist/odu_type (identityref) + + YANG Description: ODU type + """ + return self.__odu_type + + def _set_odu_type(self, v, load=False): + """ + Setter method for odu_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist/odu_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type() directly. + + YANG Description: ODU type + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__odu_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type(self): + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_number(self): + """ + Getter method for number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist/number (uint16) + + YANG Description: Number of ODUs + """ + return self.__number + + def _set_number(self, v, load=False): + """ + Setter method for number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist/number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_number() directly. + + YANG Description: Number of ODUs + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__number = t + if hasattr(self, '_set'): + self._set() + + def _unset_number(self): + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + + def _get_ts_number(self): + """ + Getter method for ts_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist/ts_number (uint16) + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + return self.__ts_number + + def _set_ts_number(self, v, load=False): + """ + Setter method for ts_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_constraints/te_bandwidth/otn/odulist/ts_number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_number() directly. + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__ts_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_number(self): + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + odu_type = __builtin__.property(_get_odu_type, _set_odu_type) + number = __builtin__.property(_get_number, _set_number) + ts_number = __builtin__.property(_get_ts_number, _set_ts_number) + + __choices__ = {'technology': {'otn': ['odu_type', 'number', 'ts_number']}} + _pyangbind_elements = OrderedDict([('odu_type', odu_type), ('number', number), ('ts_number', ts_number), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/__init__.py new file mode 100644 index 000000000..32bb9a553 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/__init__.py @@ -0,0 +1,318 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_metric +from . import path_affinities_values +from . import path_affinity_names +from . import path_srlgs_lists +from . import path_srlgs_names +from . import path_route_objects +class path_properties(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-properties. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The TE path properties. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_metric','__path_affinities_values','__path_affinity_names','__path_srlgs_lists','__path_srlgs_names','__path_route_objects',) + + _yang_name = 'path-properties' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_metric = YANGDynClass(base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_route_objects = YANGDynClass(base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-properties'] + + def _get_path_metric(self): + """ + Getter method for path_metric, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_metric (list) + + YANG Description: TE path metric type. + """ + return self.__path_metric + + def _set_path_metric(self, v, load=False): + """ + Setter method for path_metric, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_metric (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_metric is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_metric() directly. + + YANG Description: TE path metric type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_metric must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_metric = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_metric(self): + self.__path_metric = YANGDynClass(base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + + def _get_path_affinities_values(self): + """ + Getter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values (container) + + YANG Description: Path affinities represented as values. + """ + return self.__path_affinities_values + + def _set_path_affinities_values(self, v, load=False): + """ + Setter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_values() directly. + + YANG Description: Path affinities represented as values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_values must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_affinities_values = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_values(self): + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_affinity_names(self): + """ + Getter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names (container) + + YANG Description: Path affinities represented as names. + """ + return self.__path_affinity_names + + def _set_path_affinity_names(self, v, load=False): + """ + Setter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_names() directly. + + YANG Description: Path affinities represented as names. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_affinity_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_names(self): + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_srlgs_lists(self): + """ + Getter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists (container) + + YANG Description: Path SRLG properties container. + """ + return self.__path_srlgs_lists + + def _set_path_srlgs_lists(self, v, load=False): + """ + Setter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_lists is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_lists() directly. + + YANG Description: Path SRLG properties container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_lists must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_srlgs_lists = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_lists(self): + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_srlgs_names(self): + """ + Getter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names (container) + + YANG Description: Container for the list of named SRLGs. + """ + return self.__path_srlgs_names + + def _set_path_srlgs_names(self, v, load=False): + """ + Setter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_names() directly. + + YANG Description: Container for the list of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_srlgs_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_names(self): + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_route_objects(self): + """ + Getter method for path_route_objects, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects (container) + + YANG Description: Container for the list of route objects either returned by +the computation engine or actually used by an LSP. + """ + return self.__path_route_objects + + def _set_path_route_objects(self, v, load=False): + """ + Setter method for path_route_objects, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_route_objects is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_route_objects() directly. + + YANG Description: Container for the list of route objects either returned by +the computation engine or actually used by an LSP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_route_objects must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_route_objects = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_route_objects(self): + self.__path_route_objects = YANGDynClass(base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + path_metric = __builtin__.property(_get_path_metric) + path_affinities_values = __builtin__.property(_get_path_affinities_values) + path_affinity_names = __builtin__.property(_get_path_affinity_names) + path_srlgs_lists = __builtin__.property(_get_path_srlgs_lists) + path_srlgs_names = __builtin__.property(_get_path_srlgs_names) + path_route_objects = __builtin__.property(_get_path_route_objects) + + + _pyangbind_elements = OrderedDict([('path_metric', path_metric), ('path_affinities_values', path_affinities_values), ('path_affinity_names', path_affinity_names), ('path_srlgs_lists', path_srlgs_lists), ('path_srlgs_names', path_srlgs_names), ('path_route_objects', path_route_objects), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/__init__.py new file mode 100644 index 000000000..a7001481d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_affinities_value +class path_affinities_values(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-properties/path-affinities-values. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as values. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinities_value',) + + _yang_name = 'path-affinities-values' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-affinities-values'] + + def _get_path_affinities_value(self): + """ + Getter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinities_value + + def _set_path_affinities_value(self, v, load=False): + """ + Setter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_value() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_value must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_affinities_value = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_value(self): + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_affinities_value = __builtin__.property(_get_path_affinities_value) + + + _pyangbind_elements = OrderedDict([('path_affinities_value', path_affinities_value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value/__init__.py new file mode 100644 index 000000000..d762b9990 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value/__init__.py @@ -0,0 +1,161 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_affinities_value(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-properties/path-affinities-values/path-affinities-value. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__value',) + + _yang_name = 'path-affinities-value' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-affinities-values', 'path-affinities-value'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value/usage (identityref) + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_value(self): + """ + Getter method for value, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value/value (admin-groups) + + YANG Description: The affinity value. The default is empty. + """ + return self.__value + + def _set_value(self, v, load=False): + """ + Setter method for value, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinities_values/path_affinities_value/value (admin-groups) + If this variable is read-only (config: false) in the + source YANG file, then _set_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_value() directly. + + YANG Description: The affinity value. The default is empty. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """value must be of a type compatible with admin-groups""", + 'defined-type': "ietf-te-topology:admin-groups", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False)""", + }) + + self.__value = t + if hasattr(self, '_set'): + self._set() + + def _unset_value(self): + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False) + + usage = __builtin__.property(_get_usage) + value = __builtin__.property(_get_value) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('value', value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/__init__.py new file mode 100644 index 000000000..76beb2d04 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_affinity_name +class path_affinity_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-properties/path-affinity-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as names. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinity_name',) + + _yang_name = 'path-affinity-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-affinity-names'] + + def _get_path_affinity_name(self): + """ + Getter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinity_name + + def _set_path_affinity_name(self, v, load=False): + """ + Setter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_name() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_name(self): + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_affinity_name = __builtin__.property(_get_path_affinity_name) + + + _pyangbind_elements = OrderedDict([('path_affinity_name', path_affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/__init__.py new file mode 100644 index 000000000..04f8c534e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/__init__.py @@ -0,0 +1,162 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import affinity_name +class path_affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-properties/path-affinity-names/path-affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__affinity_name',) + + _yang_name = 'path-affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-affinity-names', 'path-affinity-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/usage (identityref) + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_affinity_name(self): + """ + Getter method for affinity_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/affinity_name (list) + + YANG Description: List of named affinities. + """ + return self.__affinity_name + + def _set_affinity_name(self, v, load=False): + """ + Setter method for affinity_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_affinity_name() directly. + + YANG Description: List of named affinities. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_affinity_name(self): + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + usage = __builtin__.property(_get_usage) + affinity_name = __builtin__.property(_get_affinity_name) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('affinity_name', affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py new file mode 100644 index 000000000..c8ffc5629 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-properties/path-affinity-names/path-affinity-name/affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinities. + """ + __slots__ = ('_path_helper', '_extmethods', '__name',) + + _yang_name = 'affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-affinity-names', 'path-affinity-name', 'affinity-name'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/affinity_name/name (string) + + YANG Description: Identifies a named affinity entry. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_affinity_names/path_affinity_name/affinity_name/name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: Identifies a named affinity entry. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + name = __builtin__.property(_get_name) + + + _pyangbind_elements = OrderedDict([('name', name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_metric/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_metric/__init__.py new file mode 100644 index 000000000..6bea27715 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_metric/__init__.py @@ -0,0 +1,159 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_metric(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-properties/path-metric. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE path metric type. + """ + __slots__ = ('_path_helper', '_extmethods', '__metric_type','__accumulative_value',) + + _yang_name = 'path-metric' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__accumulative_value = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-metric'] + + def _get_metric_type(self): + """ + Getter method for metric_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_metric/metric_type (identityref) + + YANG Description: TE path metric type. + """ + return self.__metric_type + + def _set_metric_type(self, v, load=False): + """ + Setter method for metric_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_metric/metric_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_metric_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_metric_type() directly. + + YANG Description: TE path metric type. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """metric_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__metric_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_metric_type(self): + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_accumulative_value(self): + """ + Getter method for accumulative_value, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_metric/accumulative_value (uint64) + + YANG Description: TE path metric accumulative value. + """ + return self.__accumulative_value + + def _set_accumulative_value(self, v, load=False): + """ + Setter method for accumulative_value, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_metric/accumulative_value (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_accumulative_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_accumulative_value() directly. + + YANG Description: TE path metric accumulative value. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """accumulative_value must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False)""", + }) + + self.__accumulative_value = t + if hasattr(self, '_set'): + self._set() + + def _unset_accumulative_value(self): + self.__accumulative_value = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + + metric_type = __builtin__.property(_get_metric_type) + accumulative_value = __builtin__.property(_get_accumulative_value) + + + _pyangbind_elements = OrderedDict([('metric_type', metric_type), ('accumulative_value', accumulative_value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/__init__.py new file mode 100644 index 000000000..fb3b4a46d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/__init__.py @@ -0,0 +1,119 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_route_object +class path_route_objects(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-properties/path-route-objects. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of route objects either returned by +the computation engine or actually used by an LSP. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_route_object',) + + _yang_name = 'path-route-objects' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_route_object = YANGDynClass(base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-route-objects'] + + def _get_path_route_object(self): + """ + Getter method for path_route_object, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object (list) + + YANG Description: List of route objects either returned by the computation +engine or actually used by an LSP. + """ + return self.__path_route_object + + def _set_path_route_object(self, v, load=False): + """ + Setter method for path_route_object, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_route_object is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_route_object() directly. + + YANG Description: List of route objects either returned by the computation +engine or actually used by an LSP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_route_object must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_route_object = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_route_object(self): + self.__path_route_object = YANGDynClass(base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_route_object = __builtin__.property(_get_path_route_object) + + + _pyangbind_elements = OrderedDict([('path_route_object', path_route_object), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/__init__.py new file mode 100644 index 000000000..4fe9aa220 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/__init__.py @@ -0,0 +1,327 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class path_route_object(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-properties/path-route-objects/path-route-object. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of route objects either returned by the computation +engine or actually used by an LSP. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'path-route-object' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-route-objects', 'path-route-object'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/index (uint32) + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key +values. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/index (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key +values. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + index = __builtin__.property(_get_index) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop) + label_hop = __builtin__.property(_get_label_hop) + + __choices__ = {'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('index', index), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/as_number_hop/__init__.py new file mode 100644 index 000000000..11ddae417 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-properties/path-route-objects/path-route-object/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-route-objects', 'path-route-object', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + as_number = __builtin__.property(_get_as_number) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/__init__.py new file mode 100644 index 000000000..7440b8732 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-properties/path-route-objects/path-route-object/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-route-objects', 'path-route-object', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_label = __builtin__.property(_get_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/__init__.py new file mode 100644 index 000000000..6fc49cf75 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-properties/path-route-objects/path-route-object/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-route-objects', 'path-route-object', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + vlanid = __builtin__.property(_get_vlanid) + direction = __builtin__.property(_get_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/__init__.py new file mode 100644 index 000000000..d758b2922 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-properties/path-route-objects/path-route-object/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-route-objects', 'path-route-object', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + + tpn = __builtin__.property(_get_tpn) + tsg = __builtin__.property(_get_tsg) + ts_list = __builtin__.property(_get_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop/__init__.py new file mode 100644 index 000000000..a1a29aebb --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-properties/path-route-objects/path-route-object/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-route-objects', 'path-route-object', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_node_hop/__init__.py new file mode 100644 index 000000000..4ca5c4eec --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-properties/path-route-objects/path-route-object/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-route-objects', 'path-route-object', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_node_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/__init__.py new file mode 100644 index 000000000..3ec157d35 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-properties/path-route-objects/path-route-object/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-route-objects', 'path-route-object', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/__init__.py new file mode 100644 index 000000000..e509790c4 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_srlgs_list +class path_srlgs_lists(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-properties/path-srlgs-lists. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path SRLG properties container. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_list',) + + _yang_name = 'path-srlgs-lists' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-srlgs-lists'] + + def _get_path_srlgs_list(self): + """ + Getter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list (list) + + YANG Description: List of SRLG values to be included or excluded. + """ + return self.__path_srlgs_list + + def _set_path_srlgs_list(self, v, load=False): + """ + Setter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_list() directly. + + YANG Description: List of SRLG values to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_list must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_srlgs_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_list(self): + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_srlgs_list = __builtin__.property(_get_path_srlgs_list) + + + _pyangbind_elements = OrderedDict([('path_srlgs_list', path_srlgs_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py new file mode 100644 index 000000000..37a85c235 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py @@ -0,0 +1,161 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_srlgs_list(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-properties/path-srlgs-lists/path-srlgs-list. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of SRLG values to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__values',) + + _yang_name = 'path-srlgs-list' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-srlgs-lists', 'path-srlgs-list'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list/usage (identityref) + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_values(self): + """ + Getter method for values, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list/values (srlg) + + YANG Description: List of SRLG values. + """ + return self.__values + + def _set_values(self, v, load=False): + """ + Setter method for values, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_lists/path_srlgs_list/values (srlg) + If this variable is read-only (config: false) in the + source YANG file, then _set_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_values() directly. + + YANG Description: List of SRLG values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """values must be of a type compatible with srlg""", + 'defined-type': "ietf-te-topology:srlg", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False)""", + }) + + self.__values = t + if hasattr(self, '_set'): + self._set() + + def _unset_values(self): + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False) + + usage = __builtin__.property(_get_usage) + values = __builtin__.property(_get_values) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('values', values), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/__init__.py new file mode 100644 index 000000000..4e96bae2f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_srlgs_name +class path_srlgs_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-properties/path-srlgs-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of named SRLGs. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_name',) + + _yang_name = 'path-srlgs-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-srlgs-names'] + + def _get_path_srlgs_name(self): + """ + Getter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name (list) + + YANG Description: List of named SRLGs to be included or excluded. + """ + return self.__path_srlgs_name + + def _set_path_srlgs_name(self, v, load=False): + """ + Setter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_name() directly. + + YANG Description: List of named SRLGs to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_srlgs_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_name(self): + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_srlgs_name = __builtin__.property(_get_path_srlgs_name) + + + _pyangbind_elements = OrderedDict([('path_srlgs_name', path_srlgs_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name/__init__.py new file mode 100644 index 000000000..ec8734fe0 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name/__init__.py @@ -0,0 +1,161 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_srlgs_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/path-properties/path-srlgs-names/path-srlgs-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named SRLGs to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__names',) + + _yang_name = 'path-srlgs-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'path-properties', 'path-srlgs-names', 'path-srlgs-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name/usage (identityref) + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_names(self): + """ + Getter method for names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name/names (string) + + YANG Description: List of named SRLGs. + """ + return self.__names + + def _set_names(self, v, load=False): + """ + Setter method for names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/path_properties/path_srlgs_names/path_srlgs_name/names (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_names() directly. + + YANG Description: List of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """names must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__names = t + if hasattr(self, '_set'): + self._set() + + def _unset_names(self): + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + usage = __builtin__.property(_get_usage) + names = __builtin__.property(_get_names) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('names', names), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/__init__.py new file mode 100644 index 000000000..9fb672458 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/__init__.py @@ -0,0 +1,155 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import label_restrictions +class to(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/to. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Reference to a destination LTP. + """ + __slots__ = ('_path_helper', '_extmethods', '__tp_ref','__label_restrictions',) + + _yang_name = 'to' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tp_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + self.__label_restrictions = YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'to'] + + def _get_tp_ref(self): + """ + Getter method for tp_ref, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/tp_ref (leafref) + + YANG Description: Relative reference to a termination point. + """ + return self.__tp_ref + + def _set_tp_ref(self, v, load=False): + """ + Setter method for tp_ref, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/tp_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tp_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tp_ref() directly. + + YANG Description: Relative reference to a termination point. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tp_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__tp_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_tp_ref(self): + self.__tp_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + + def _get_label_restrictions(self): + """ + Getter method for label_restrictions, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions (container) + + YANG Description: The label restrictions container. + """ + return self.__label_restrictions + + def _set_label_restrictions(self, v, load=False): + """ + Setter method for label_restrictions, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_restrictions is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_restrictions() directly. + + YANG Description: The label restrictions container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_restrictions must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_restrictions = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_restrictions(self): + self.__label_restrictions = YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + tp_ref = __builtin__.property(_get_tp_ref, _set_tp_ref) + label_restrictions = __builtin__.property(_get_label_restrictions, _set_label_restrictions) + + + _pyangbind_elements = OrderedDict([('tp_ref', tp_ref), ('label_restrictions', label_restrictions), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/__init__.py new file mode 100644 index 000000000..8dfdb0a63 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/__init__.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import label_restriction +class label_restrictions(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/to/label-restrictions. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The label restrictions container. + """ + __slots__ = ('_path_helper', '_extmethods', '__label_restriction',) + + _yang_name = 'label-restrictions' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__label_restriction = YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions'] + + def _get_label_restriction(self): + """ + Getter method for label_restriction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction (list) + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + return self.__label_restriction + + def _set_label_restriction(self, v, load=False): + """ + Setter method for label_restriction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_restriction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_restriction() directly. + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_restriction must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__label_restriction = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_restriction(self): + self.__label_restriction = YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + label_restriction = __builtin__.property(_get_label_restriction, _set_label_restriction) + + + _pyangbind_elements = OrderedDict([('label_restriction', label_restriction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/__init__.py new file mode 100644 index 000000000..3b116c4b7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/__init__.py @@ -0,0 +1,450 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import label_start +from . import label_end +from . import label_step +from . import otn_label_range +from . import ethernet_label_range +class label_restriction(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/to/label-restrictions/label-restriction. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + __slots__ = ('_path_helper', '_extmethods', '__restriction','__index','__label_start','__label_end','__label_step','__range_bitmap','__otn_label_range','__ethernet_label_range',) + + _yang_name = 'label-restriction' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__restriction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__label_start = YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_end = YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_step = YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__range_bitmap = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True) + self.__otn_label_range = YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__ethernet_label_range = YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions', 'label-restriction'] + + def _get_restriction(self): + """ + Getter method for restriction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/restriction (enumeration) + + YANG Description: Indicates whether the list item is inclusive or exclusive. + """ + return self.__restriction + + def _set_restriction(self, v, load=False): + """ + Setter method for restriction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/restriction (enumeration) + If this variable is read-only (config: false) in the + source YANG file, then _set_restriction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_restriction() directly. + + YANG Description: Indicates whether the list item is inclusive or exclusive. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """restriction must be of a type compatible with enumeration""", + 'defined-type': "ietf-te-topology:enumeration", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True)""", + }) + + self.__restriction = t + if hasattr(self, '_set'): + self._set() + + def _unset_restriction(self): + self.__restriction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/index (uint32) + + YANG Description: The index of the label restriction list entry. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/index (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: The index of the label restriction list entry. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_label_start(self): + """ + Getter method for label_start, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start (container) + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + return self.__label_start + + def _set_label_start(self, v, load=False): + """ + Setter method for label_start, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_start is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_start() directly. + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_start must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_start = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_start(self): + self.__label_start = YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_end(self): + """ + Getter method for label_end, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end (container) + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + return self.__label_end + + def _set_label_end(self, v, load=False): + """ + Setter method for label_end, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_end is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_end() directly. + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_end must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_end = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_end(self): + self.__label_end = YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_step(self): + """ + Getter method for label_step, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step (container) + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + return self.__label_step + + def _set_label_step(self, v, load=False): + """ + Setter method for label_step, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_step is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_step() directly. + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_step must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_step = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_step(self): + self.__label_step = YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_range_bitmap(self): + """ + Getter method for range_bitmap, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/range_bitmap (yang:hex-string) + + YANG Description: When there are gaps between 'label-start' and 'label-end', +this attribute is used to specify the positions +of the used labels. This is represented in big endian as +'hex-string'. +The most significant byte in the hex-string is the farthest +to the left in the byte sequence. Leading zero bytes in the +configured value may be omitted for brevity. +Each bit position in the 'range-bitmap' 'hex-string' maps +to a label in the range derived from 'label-start'. + +For example, assuming that 'label-start' = 16000 and +'range-bitmap' = 0x01000001, then: + +- bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. +- bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1. + """ + return self.__range_bitmap + + def _set_range_bitmap(self, v, load=False): + """ + Setter method for range_bitmap, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/range_bitmap (yang:hex-string) + If this variable is read-only (config: false) in the + source YANG file, then _set_range_bitmap is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_range_bitmap() directly. + + YANG Description: When there are gaps between 'label-start' and 'label-end', +this attribute is used to specify the positions +of the used labels. This is represented in big endian as +'hex-string'. +The most significant byte in the hex-string is the farthest +to the left in the byte sequence. Leading zero bytes in the +configured value may be omitted for brevity. +Each bit position in the 'range-bitmap' 'hex-string' maps +to a label in the range derived from 'label-start'. + +For example, assuming that 'label-start' = 16000 and +'range-bitmap' = 0x01000001, then: + +- bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. +- bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """range_bitmap must be of a type compatible with yang:hex-string""", + 'defined-type': "yang:hex-string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True)""", + }) + + self.__range_bitmap = t + if hasattr(self, '_set'): + self._set() + + def _unset_range_bitmap(self): + self.__range_bitmap = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True) + + + def _get_otn_label_range(self): + """ + Getter method for otn_label_range, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range (container) + + YANG Description: Label range information for OTN. + """ + return self.__otn_label_range + + def _set_otn_label_range(self, v, load=False): + """ + Setter method for otn_label_range, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn_label_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn_label_range() directly. + + YANG Description: Label range information for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn_label_range must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn_label_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn_label_range(self): + self.__otn_label_range = YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_ethernet_label_range(self): + """ + Getter method for ethernet_label_range, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/ethernet_label_range (container) + + YANG Description: Ethernet-specific label range related information. + """ + return self.__ethernet_label_range + + def _set_ethernet_label_range(self, v, load=False): + """ + Setter method for ethernet_label_range, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/ethernet_label_range (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_ethernet_label_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ethernet_label_range() directly. + + YANG Description: Ethernet-specific label range related information. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ethernet_label_range must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True)""", + }) + + self.__ethernet_label_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_ethernet_label_range(self): + self.__ethernet_label_range = YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + restriction = __builtin__.property(_get_restriction, _set_restriction) + index = __builtin__.property(_get_index, _set_index) + label_start = __builtin__.property(_get_label_start, _set_label_start) + label_end = __builtin__.property(_get_label_end, _set_label_end) + label_step = __builtin__.property(_get_label_step, _set_label_step) + range_bitmap = __builtin__.property(_get_range_bitmap, _set_range_bitmap) + otn_label_range = __builtin__.property(_get_otn_label_range, _set_otn_label_range) + ethernet_label_range = __builtin__.property(_get_ethernet_label_range, _set_ethernet_label_range) + + + _pyangbind_elements = OrderedDict([('restriction', restriction), ('index', index), ('label_start', label_start), ('label_end', label_end), ('label_step', label_step), ('range_bitmap', range_bitmap), ('otn_label_range', otn_label_range), ('ethernet_label_range', ethernet_label_range), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/ethernet_label_range/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/ethernet_label_range/__init__.py new file mode 100644 index 000000000..c9f4959da --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/ethernet_label_range/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class ethernet_label_range(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/to/label-restrictions/label-restriction/ethernet-label-range. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Ethernet-specific label range related information. + """ + __slots__ = ('_path_helper', '_extmethods', '__tag_type','__priority',) + + _yang_name = 'ethernet-label-range' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tag_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions', 'label-restriction', 'ethernet-label-range'] + + def _get_tag_type(self): + """ + Getter method for tag_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/ethernet_label_range/tag_type (etht-types:eth-tag-type) + + YANG Description: VLAN tag type. + """ + return self.__tag_type + + def _set_tag_type(self, v, load=False): + """ + Setter method for tag_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/ethernet_label_range/tag_type (etht-types:eth-tag-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_tag_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tag_type() directly. + + YANG Description: VLAN tag type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tag_type must be of a type compatible with etht-types:eth-tag-type""", + 'defined-type': "etht-types:eth-tag-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True)""", + }) + + self.__tag_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_tag_type(self): + self.__tag_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/ethernet_label_range/priority (uint8) + + YANG Description: priority. + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/ethernet_label_range/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: priority. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True) + + tag_type = __builtin__.property(_get_tag_type, _set_tag_type) + priority = __builtin__.property(_get_priority, _set_priority) + + + _pyangbind_elements = OrderedDict([('tag_type', tag_type), ('priority', priority), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/__init__.py new file mode 100644 index 000000000..c5f363333 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/__init__.py @@ -0,0 +1,119 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_end(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/to/label-restrictions/label-restriction/label-end. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-end' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions', 'label-restriction', 'label-end'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/__init__.py new file mode 100644 index 000000000..09a0f03ed --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/to/label-restrictions/label-restriction/label-end/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions', 'label-restriction', 'label-end', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/otn (container) + + YANG Description: Label start or label end for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label start or label end for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py new file mode 100644 index 000000000..74637ab69 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/to/label-restrictions/label-restriction/label-end/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label start or label end for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions', 'label-restriction', 'label-end', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/otn/ts (otn-ts) + + YANG Description: Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_end/te_label/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + ts = __builtin__.property(_get_ts, _set_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/__init__.py new file mode 100644 index 000000000..55e8ab30e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/__init__.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_start(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/to/label-restrictions/label-restriction/label-start. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-start' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions', 'label-restriction', 'label-start'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/__init__.py new file mode 100644 index 000000000..c2477e817 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/to/label-restrictions/label-restriction/label-start/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions', 'label-restriction', 'label-start', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/otn (container) + + YANG Description: Label start or label end for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label start or label end for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py new file mode 100644 index 000000000..cbb3ec616 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/to/label-restrictions/label-restriction/label-start/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label start or label end for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions', 'label-restriction', 'label-start', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/otn/ts (otn-ts) + + YANG Description: Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_start/te_label/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + ts = __builtin__.property(_get_ts, _set_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/__init__.py new file mode 100644 index 000000000..570cd69b5 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/__init__.py @@ -0,0 +1,200 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class label_step(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/to/label-restrictions/label-restriction/label-step. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_step',) + + _yang_name = 'label-step' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__eth_step = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions', 'label-restriction', 'label-step'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/generic (int32) + + YANG Description: Label range step. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/generic (int32) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Label range step. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with int32""", + 'defined-type': "int32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/otn (container) + + YANG Description: Label step for OTN + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label step for OTN + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_eth_step(self): + """ + Getter method for eth_step, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/eth_step (uint16) + + YANG Description: Label step which represent possible increments for +an Ethernet VLAN tag. + """ + return self.__eth_step + + def _set_eth_step(self, v, load=False): + """ + Setter method for eth_step, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/eth_step (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_step is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_step() directly. + + YANG Description: Label step which represent possible increments for +an Ethernet VLAN tag. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_step must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True)""", + }) + + self.__eth_step = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_step(self): + self.__eth_step = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + eth_step = __builtin__.property(_get_eth_step, _set_eth_step) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['eth_step']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_step', eth_step), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/otn/__init__.py new file mode 100644 index 000000000..541e34252 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/otn/__init__.py @@ -0,0 +1,158 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/to/label-restrictions/label-restriction/label-step/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label step for OTN + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions', 'label-restriction', 'label-step', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/otn/tpn (otn-tpn) + + YANG Description: Label step which represents possible increments for +Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Label step which represents possible increments for +Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/otn/ts (otn-ts) + + YANG Description: Label step which represents possible increments for +Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/label_step/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Label step which represents possible increments for +Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + ts = __builtin__.property(_get_ts, _set_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/__init__.py new file mode 100644 index 000000000..2cae8d9a9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/__init__.py @@ -0,0 +1,256 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn_label_range(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/to/label-restrictions/label-restriction/otn-label-range. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label range information for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__range_type','__tsg','__odu_type_list','__priority',) + + _yang_name = 'otn-label-range' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__range_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__odu_type_list = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'to', 'label-restrictions', 'label-restriction', 'otn-label-range'] + + def _get_range_type(self): + """ + Getter method for range_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/range_type (otn-label-range-type) + + YANG Description: The type of range (e.g., TPN or TS) +to which the label range applies + """ + return self.__range_type + + def _set_range_type(self, v, load=False): + """ + Setter method for range_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/range_type (otn-label-range-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_range_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_range_type() directly. + + YANG Description: The type of range (e.g., TPN or TS) +to which the label range applies + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """range_type must be of a type compatible with otn-label-range-type""", + 'defined-type': "ietf-otn-topology:otn-label-range-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True)""", + }) + + self.__range_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_range_type(self): + self.__range_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/tsg (identityref) + + YANG Description: Tributary slot granularity (TSG) to which the label range +applies. + +This leaf MUST be present when the range-type is TS. + +This leaf MAY be omitted when mapping an ODUk over an OTUk +Link. In this case the range-type is tpn, with only one +entry (ODUk), and the tpn range has only one value (1). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary slot granularity (TSG) to which the label range +applies. + +This leaf MUST be present when the range-type is TS. + +This leaf MAY be omitted when mapping an ODUk over an OTUk +Link. In this case the range-type is tpn, with only one +entry (ODUk), and the tpn range has only one value (1). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_odu_type_list(self): + """ + Getter method for odu_type_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/odu_type_list (identityref) + + YANG Description: List of ODU types to which the label range applies. + +An Empty odu-type-list means that the label range +applies to all the supported ODU types. + """ + return self.__odu_type_list + + def _set_odu_type_list(self, v, load=False): + """ + Setter method for odu_type_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/odu_type_list (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type_list() directly. + + YANG Description: List of ODU types to which the label range applies. + +An Empty odu-type-list means that the label range +applies to all the supported ODU types. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type_list must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__odu_type_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type_list(self): + self.__odu_type_list = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/priority (uint8) + + YANG Description: Priority in Interface Switching Capability +Descriptor (ISCD). + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/to/label_restrictions/label_restriction/otn_label_range/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: Priority in Interface Switching Capability +Descriptor (ISCD). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True) + + range_type = __builtin__.property(_get_range_type, _set_range_type) + tsg = __builtin__.property(_get_tsg, _set_tsg) + odu_type_list = __builtin__.property(_get_odu_type_list, _set_odu_type_list) + priority = __builtin__.property(_get_priority, _set_priority) + + + _pyangbind_elements = OrderedDict([('range_type', range_type), ('tsg', tsg), ('odu_type_list', odu_type_list), ('priority', priority), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/__init__.py new file mode 100644 index 000000000..29a2ea0fd --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/__init__.py @@ -0,0 +1,326 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import primary_path +from . import backup_path +from . import tunnel_termination_points +from . import tunnels +class underlay(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/underlay. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Attributes of the TE link underlay. + """ + __slots__ = ('_path_helper', '_extmethods', '__enabled','__primary_path','__backup_path','__protection_type','__tunnel_termination_points','__tunnels',) + + _yang_name = 'underlay' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__enabled = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + self.__primary_path = YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__backup_path = YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + self.__protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__tunnel_termination_points = YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__tunnels = YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'underlay'] + + def _get_enabled(self): + """ + Getter method for enabled, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/enabled (boolean) + + YANG Description: 'true' if the underlay is enabled. +'false' if the underlay is disabled. + """ + return self.__enabled + + def _set_enabled(self, v, load=False): + """ + Setter method for enabled, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/enabled (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_enabled is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_enabled() directly. + + YANG Description: 'true' if the underlay is enabled. +'false' if the underlay is disabled. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """enabled must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__enabled = t + if hasattr(self, '_set'): + self._set() + + def _unset_enabled(self): + self.__enabled = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + + def _get_primary_path(self): + """ + Getter method for primary_path, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path (container) + + YANG Description: The service path on the underlay topology that +supports this link. + """ + return self.__primary_path + + def _set_primary_path(self, v, load=False): + """ + Setter method for primary_path, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_primary_path is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_primary_path() directly. + + YANG Description: The service path on the underlay topology that +supports this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """primary_path must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__primary_path = t + if hasattr(self, '_set'): + self._set() + + def _unset_primary_path(self): + self.__primary_path = YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_backup_path(self): + """ + Getter method for backup_path, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path (list) + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + return self.__backup_path + + def _set_backup_path(self, v, load=False): + """ + Setter method for backup_path, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_backup_path is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_backup_path() directly. + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """backup_path must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__backup_path = t + if hasattr(self, '_set'): + self._set() + + def _unset_backup_path(self): + self.__backup_path = YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + + def _get_protection_type(self): + """ + Getter method for protection_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/protection_type (identityref) + + YANG Description: Underlay protection type desired for this link. + """ + return self.__protection_type + + def _set_protection_type(self, v, load=False): + """ + Setter method for protection_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/protection_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_protection_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_protection_type() directly. + + YANG Description: Underlay protection type desired for this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """protection_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__protection_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_protection_type(self): + self.__protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_tunnel_termination_points(self): + """ + Getter method for tunnel_termination_points, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points (container) + + YANG Description: Underlay TTPs desired for this link. + """ + return self.__tunnel_termination_points + + def _set_tunnel_termination_points(self, v, load=False): + """ + Setter method for tunnel_termination_points, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel_termination_points is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel_termination_points() directly. + + YANG Description: Underlay TTPs desired for this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel_termination_points must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__tunnel_termination_points = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel_termination_points(self): + self.__tunnel_termination_points = YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_tunnels(self): + """ + Getter method for tunnels, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnels (container) + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + return self.__tunnels + + def _set_tunnels(self, v, load=False): + """ + Setter method for tunnels, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnels (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnels is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnels() directly. + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnels must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__tunnels = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnels(self): + self.__tunnels = YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + enabled = __builtin__.property(_get_enabled, _set_enabled) + primary_path = __builtin__.property(_get_primary_path, _set_primary_path) + backup_path = __builtin__.property(_get_backup_path, _set_backup_path) + protection_type = __builtin__.property(_get_protection_type, _set_protection_type) + tunnel_termination_points = __builtin__.property(_get_tunnel_termination_points, _set_tunnel_termination_points) + tunnels = __builtin__.property(_get_tunnels, _set_tunnels) + + + _pyangbind_elements = OrderedDict([('enabled', enabled), ('primary_path', primary_path), ('backup_path', backup_path), ('protection_type', protection_type), ('tunnel_termination_points', tunnel_termination_points), ('tunnels', tunnels), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/__init__.py new file mode 100644 index 000000000..408b97bc6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/__init__.py @@ -0,0 +1,207 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_element +class backup_path(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/underlay/backup-path. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__network_ref','__path_element',) + + _yang_name = 'backup-path' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'backup-path'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/index (uint32) + + YANG Description: A sequence number to identify a backup path. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/index (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: A sequence number to identify a backup path. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + + def _get_path_element(self): + """ + Getter method for path_element, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element (list) + + YANG Description: A list of path elements describing the backup service +path. + """ + return self.__path_element + + def _set_path_element(self, v, load=False): + """ + Setter method for path_element, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element() directly. + + YANG Description: A list of path elements describing the backup service +path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_element = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element(self): + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + index = __builtin__.property(_get_index, _set_index) + network_ref = __builtin__.property(_get_network_ref, _set_network_ref) + path_element = __builtin__.property(_get_path_element, _set_path_element) + + + _pyangbind_elements = OrderedDict([('index', index), ('network_ref', network_ref), ('path_element', path_element), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/__init__.py new file mode 100644 index 000000000..53ca0bce5 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/__init__.py @@ -0,0 +1,321 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class path_element(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/underlay/backup-path/path-element. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of path elements describing the backup service +path. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_element_id','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'path-element' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'backup-path', 'path-element'] + + def _get_path_element_id(self): + """ + Getter method for path_element_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/path_element_id (uint32) + + YANG Description: To identify the element in a path. + """ + return self.__path_element_id + + def _set_path_element_id(self, v, load=False): + """ + Setter method for path_element_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/path_element_id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element_id() directly. + + YANG Description: To identify the element in a path. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element_id must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__path_element_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element_id(self): + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + path_element_id = __builtin__.property(_get_path_element_id, _set_path_element_id) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop, _set_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop, _set_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop, _set_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop, _set_as_number_hop) + label_hop = __builtin__.property(_get_label_hop, _set_label_hop) + + __choices__ = {'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('path_element_id', path_element_id), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/as_number_hop/__init__.py new file mode 100644 index 000000000..b0ecb1150 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/underlay/backup-path/path-element/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'backup-path', 'path-element', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + as_number = __builtin__.property(_get_as_number, _set_as_number) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/__init__.py new file mode 100644 index 000000000..cbd8c31c1 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/underlay/backup-path/path-element/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'backup-path', 'path-element', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/__init__.py new file mode 100644 index 000000000..3b1310552 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/underlay/backup-path/path-element/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'backup-path', 'path-element', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py new file mode 100644 index 000000000..92e4b3b20 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/underlay/backup-path/path-element/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'backup-path', 'path-element', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + tsg = __builtin__.property(_get_tsg, _set_tsg) + ts_list = __builtin__.property(_get_ts_list, _set_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop/__init__.py new file mode 100644 index 000000000..ee5484d4d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/underlay/backup-path/path-element/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'backup-path', 'path-element', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_node_hop/__init__.py new file mode 100644 index 000000000..f2167210d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/underlay/backup-path/path-element/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'backup-path', 'path-element', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_node_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py new file mode 100644 index 000000000..2d48ba9d7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/underlay/backup-path/path-element/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'backup-path', 'path-element', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/backup_path/path_element/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/__init__.py new file mode 100644 index 000000000..f2bbc86b5 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/__init__.py @@ -0,0 +1,158 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_element +class primary_path(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/underlay/primary-path. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The service path on the underlay topology that +supports this link. + """ + __slots__ = ('_path_helper', '_extmethods', '__network_ref','__path_element',) + + _yang_name = 'primary-path' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'primary-path'] + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + + def _get_path_element(self): + """ + Getter method for path_element, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element (list) + + YANG Description: A list of path elements describing the service path. + """ + return self.__path_element + + def _set_path_element(self, v, load=False): + """ + Setter method for path_element, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element() directly. + + YANG Description: A list of path elements describing the service path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_element = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element(self): + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + network_ref = __builtin__.property(_get_network_ref, _set_network_ref) + path_element = __builtin__.property(_get_path_element, _set_path_element) + + + _pyangbind_elements = OrderedDict([('network_ref', network_ref), ('path_element', path_element), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/__init__.py new file mode 100644 index 000000000..fa22d7bbd --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/__init__.py @@ -0,0 +1,320 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class path_element(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/underlay/primary-path/path-element. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of path elements describing the service path. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_element_id','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'path-element' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'primary-path', 'path-element'] + + def _get_path_element_id(self): + """ + Getter method for path_element_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/path_element_id (uint32) + + YANG Description: To identify the element in a path. + """ + return self.__path_element_id + + def _set_path_element_id(self, v, load=False): + """ + Setter method for path_element_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/path_element_id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element_id() directly. + + YANG Description: To identify the element in a path. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element_id must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__path_element_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element_id(self): + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + path_element_id = __builtin__.property(_get_path_element_id, _set_path_element_id) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop, _set_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop, _set_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop, _set_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop, _set_as_number_hop) + label_hop = __builtin__.property(_get_label_hop, _set_label_hop) + + __choices__ = {'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('path_element_id', path_element_id), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/as_number_hop/__init__.py new file mode 100644 index 000000000..5bf46184c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/underlay/primary-path/path-element/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'primary-path', 'path-element', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + as_number = __builtin__.property(_get_as_number, _set_as_number) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/__init__.py new file mode 100644 index 000000000..6377790bb --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/underlay/primary-path/path-element/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'primary-path', 'path-element', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/__init__.py new file mode 100644 index 000000000..c200f5dae --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/underlay/primary-path/path-element/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'primary-path', 'path-element', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py new file mode 100644 index 000000000..7f897420e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/underlay/primary-path/path-element/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'primary-path', 'path-element', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + tsg = __builtin__.property(_get_tsg, _set_tsg) + ts_list = __builtin__.property(_get_ts_list, _set_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop/__init__.py new file mode 100644 index 000000000..e1c306281 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/underlay/primary-path/path-element/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'primary-path', 'path-element', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_node_hop/__init__.py new file mode 100644 index 000000000..9c043b272 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/underlay/primary-path/path-element/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'primary-path', 'path-element', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_node_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py new file mode 100644 index 000000000..4f8f2de6e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/underlay/primary-path/path-element/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'primary-path', 'path-element', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/primary_path/path_element/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points/__init__.py new file mode 100644 index 000000000..6fbb783c1 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class tunnel_termination_points(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/underlay/tunnel-termination-points. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Underlay TTPs desired for this link. + """ + __slots__ = ('_path_helper', '_extmethods', '__source','__destination',) + + _yang_name = 'tunnel-termination-points' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__source = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + self.__destination = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'tunnel-termination-points'] + + def _get_source(self): + """ + Getter method for source, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points/source (binary) + + YANG Description: Source TTP identifier. + """ + return self.__source + + def _set_source(self, v, load=False): + """ + Setter method for source, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points/source (binary) + If this variable is read-only (config: false) in the + source YANG file, then _set_source is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_source() directly. + + YANG Description: Source TTP identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """source must be of a type compatible with binary""", + 'defined-type': "binary", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True)""", + }) + + self.__source = t + if hasattr(self, '_set'): + self._set() + + def _unset_source(self): + self.__source = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + + + def _get_destination(self): + """ + Getter method for destination, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points/destination (binary) + + YANG Description: Destination TTP identifier. + """ + return self.__destination + + def _set_destination(self, v, load=False): + """ + Setter method for destination, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnel_termination_points/destination (binary) + If this variable is read-only (config: false) in the + source YANG file, then _set_destination is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_destination() directly. + + YANG Description: Destination TTP identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """destination must be of a type compatible with binary""", + 'defined-type': "binary", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True)""", + }) + + self.__destination = t + if hasattr(self, '_set'): + self._set() + + def _unset_destination(self): + self.__destination = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + + source = __builtin__.property(_get_source, _set_source) + destination = __builtin__.property(_get_destination, _set_destination) + + + _pyangbind_elements = OrderedDict([('source', source), ('destination', destination), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnels/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnels/__init__.py new file mode 100644 index 000000000..f5455155f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnels/__init__.py @@ -0,0 +1,167 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import tunnel +class tunnels(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/underlay/tunnels. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + __slots__ = ('_path_helper', '_extmethods', '__sharing','__tunnel',) + + _yang_name = 'tunnels' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__sharing = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + self.__tunnel = YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'tunnels'] + + def _get_sharing(self): + """ + Getter method for sharing, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnels/sharing (boolean) + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. +This leaf is the default option for all TE tunnels +and may be overridden by the per-TE-tunnel value. + """ + return self.__sharing + + def _set_sharing(self, v, load=False): + """ + Setter method for sharing, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnels/sharing (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_sharing is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_sharing() directly. + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. +This leaf is the default option for all TE tunnels +and may be overridden by the per-TE-tunnel value. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """sharing must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__sharing = t + if hasattr(self, '_set'): + self._set() + + def _unset_sharing(self): + self.__sharing = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + + def _get_tunnel(self): + """ + Getter method for tunnel, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel (list) + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + return self.__tunnel + + def _set_tunnel(self, v, load=False): + """ + Setter method for tunnel, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel() directly. + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__tunnel = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel(self): + self.__tunnel = YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + sharing = __builtin__.property(_get_sharing, _set_sharing) + tunnel = __builtin__.property(_get_tunnel, _set_tunnel) + + + _pyangbind_elements = OrderedDict([('sharing', sharing), ('tunnel', tunnel), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel/__init__.py new file mode 100644 index 000000000..58c254b1e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel/__init__.py @@ -0,0 +1,170 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class tunnel(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/connectivity-matrix/underlay/tunnels/tunnel. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + __slots__ = ('_path_helper', '_extmethods', '__tunnel_name','__sharing',) + + _yang_name = 'tunnel' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tunnel_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + self.__sharing = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'connectivity-matrix', 'underlay', 'tunnels', 'tunnel'] + + def _get_tunnel_name(self): + """ + Getter method for tunnel_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel/tunnel_name (string) + + YANG Description: A tunnel name uniquely identifies an underlay TE tunnel, +used together with the 'source-node' value for this +link. + """ + return self.__tunnel_name + + def _set_tunnel_name(self, v, load=False): + """ + Setter method for tunnel_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel/tunnel_name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel_name() directly. + + YANG Description: A tunnel name uniquely identifies an underlay TE tunnel, +used together with the 'source-node' value for this +link. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel_name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True)""", + }) + + self.__tunnel_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel_name(self): + self.__tunnel_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + + def _get_sharing(self): + """ + Getter method for sharing, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel/sharing (boolean) + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. + """ + return self.__sharing + + def _set_sharing(self, v, load=False): + """ + Setter method for sharing, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/connectivity_matrix/underlay/tunnels/tunnel/sharing (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_sharing is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_sharing() directly. + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """sharing must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__sharing = t + if hasattr(self, '_set'): + self._set() + + def _unset_sharing(self): + self.__sharing = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + tunnel_name = __builtin__.property(_get_tunnel_name, _set_tunnel_name) + sharing = __builtin__.property(_get_sharing, _set_sharing) + + + _pyangbind_elements = OrderedDict([('tunnel_name', tunnel_name), ('sharing', sharing), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/__init__.py new file mode 100644 index 000000000..c5a9838d5 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/__init__.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import label_restriction +class label_restrictions(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/label-restrictions. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The label restrictions container. + """ + __slots__ = ('_path_helper', '_extmethods', '__label_restriction',) + + _yang_name = 'label-restrictions' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__label_restriction = YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'label-restrictions'] + + def _get_label_restriction(self): + """ + Getter method for label_restriction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction (list) + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + return self.__label_restriction + + def _set_label_restriction(self, v, load=False): + """ + Setter method for label_restriction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_restriction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_restriction() directly. + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_restriction must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__label_restriction = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_restriction(self): + self.__label_restriction = YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + label_restriction = __builtin__.property(_get_label_restriction, _set_label_restriction) + + + _pyangbind_elements = OrderedDict([('label_restriction', label_restriction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/__init__.py new file mode 100644 index 000000000..1d5b18963 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/__init__.py @@ -0,0 +1,450 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import label_start +from . import label_end +from . import label_step +from . import otn_label_range +from . import ethernet_label_range +class label_restriction(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/label-restrictions/label-restriction. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + __slots__ = ('_path_helper', '_extmethods', '__restriction','__index','__label_start','__label_end','__label_step','__range_bitmap','__otn_label_range','__ethernet_label_range',) + + _yang_name = 'label-restriction' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__restriction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__label_start = YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_end = YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_step = YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__range_bitmap = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True) + self.__otn_label_range = YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__ethernet_label_range = YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'label-restrictions', 'label-restriction'] + + def _get_restriction(self): + """ + Getter method for restriction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/restriction (enumeration) + + YANG Description: Indicates whether the list item is inclusive or exclusive. + """ + return self.__restriction + + def _set_restriction(self, v, load=False): + """ + Setter method for restriction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/restriction (enumeration) + If this variable is read-only (config: false) in the + source YANG file, then _set_restriction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_restriction() directly. + + YANG Description: Indicates whether the list item is inclusive or exclusive. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """restriction must be of a type compatible with enumeration""", + 'defined-type': "ietf-te-topology:enumeration", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True)""", + }) + + self.__restriction = t + if hasattr(self, '_set'): + self._set() + + def _unset_restriction(self): + self.__restriction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/index (uint32) + + YANG Description: The index of the label restriction list entry. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/index (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: The index of the label restriction list entry. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_label_start(self): + """ + Getter method for label_start, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start (container) + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + return self.__label_start + + def _set_label_start(self, v, load=False): + """ + Setter method for label_start, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_start is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_start() directly. + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_start must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_start = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_start(self): + self.__label_start = YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_end(self): + """ + Getter method for label_end, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end (container) + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + return self.__label_end + + def _set_label_end(self, v, load=False): + """ + Setter method for label_end, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_end is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_end() directly. + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_end must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_end = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_end(self): + self.__label_end = YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_step(self): + """ + Getter method for label_step, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step (container) + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + return self.__label_step + + def _set_label_step(self, v, load=False): + """ + Setter method for label_step, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_step is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_step() directly. + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_step must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_step = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_step(self): + self.__label_step = YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_range_bitmap(self): + """ + Getter method for range_bitmap, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/range_bitmap (yang:hex-string) + + YANG Description: When there are gaps between 'label-start' and 'label-end', +this attribute is used to specify the positions +of the used labels. This is represented in big endian as +'hex-string'. +The most significant byte in the hex-string is the farthest +to the left in the byte sequence. Leading zero bytes in the +configured value may be omitted for brevity. +Each bit position in the 'range-bitmap' 'hex-string' maps +to a label in the range derived from 'label-start'. + +For example, assuming that 'label-start' = 16000 and +'range-bitmap' = 0x01000001, then: + +- bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. +- bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1. + """ + return self.__range_bitmap + + def _set_range_bitmap(self, v, load=False): + """ + Setter method for range_bitmap, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/range_bitmap (yang:hex-string) + If this variable is read-only (config: false) in the + source YANG file, then _set_range_bitmap is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_range_bitmap() directly. + + YANG Description: When there are gaps between 'label-start' and 'label-end', +this attribute is used to specify the positions +of the used labels. This is represented in big endian as +'hex-string'. +The most significant byte in the hex-string is the farthest +to the left in the byte sequence. Leading zero bytes in the +configured value may be omitted for brevity. +Each bit position in the 'range-bitmap' 'hex-string' maps +to a label in the range derived from 'label-start'. + +For example, assuming that 'label-start' = 16000 and +'range-bitmap' = 0x01000001, then: + +- bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. +- bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """range_bitmap must be of a type compatible with yang:hex-string""", + 'defined-type': "yang:hex-string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True)""", + }) + + self.__range_bitmap = t + if hasattr(self, '_set'): + self._set() + + def _unset_range_bitmap(self): + self.__range_bitmap = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True) + + + def _get_otn_label_range(self): + """ + Getter method for otn_label_range, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/otn_label_range (container) + + YANG Description: Label range information for OTN. + """ + return self.__otn_label_range + + def _set_otn_label_range(self, v, load=False): + """ + Setter method for otn_label_range, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/otn_label_range (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn_label_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn_label_range() directly. + + YANG Description: Label range information for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn_label_range must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn_label_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn_label_range(self): + self.__otn_label_range = YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_ethernet_label_range(self): + """ + Getter method for ethernet_label_range, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/ethernet_label_range (container) + + YANG Description: Ethernet-specific label range related information. + """ + return self.__ethernet_label_range + + def _set_ethernet_label_range(self, v, load=False): + """ + Setter method for ethernet_label_range, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/ethernet_label_range (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_ethernet_label_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ethernet_label_range() directly. + + YANG Description: Ethernet-specific label range related information. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ethernet_label_range must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True)""", + }) + + self.__ethernet_label_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_ethernet_label_range(self): + self.__ethernet_label_range = YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + restriction = __builtin__.property(_get_restriction, _set_restriction) + index = __builtin__.property(_get_index, _set_index) + label_start = __builtin__.property(_get_label_start, _set_label_start) + label_end = __builtin__.property(_get_label_end, _set_label_end) + label_step = __builtin__.property(_get_label_step, _set_label_step) + range_bitmap = __builtin__.property(_get_range_bitmap, _set_range_bitmap) + otn_label_range = __builtin__.property(_get_otn_label_range, _set_otn_label_range) + ethernet_label_range = __builtin__.property(_get_ethernet_label_range, _set_ethernet_label_range) + + + _pyangbind_elements = OrderedDict([('restriction', restriction), ('index', index), ('label_start', label_start), ('label_end', label_end), ('label_step', label_step), ('range_bitmap', range_bitmap), ('otn_label_range', otn_label_range), ('ethernet_label_range', ethernet_label_range), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/ethernet_label_range/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/ethernet_label_range/__init__.py new file mode 100644 index 000000000..120438948 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/ethernet_label_range/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class ethernet_label_range(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/label-restrictions/label-restriction/ethernet-label-range. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Ethernet-specific label range related information. + """ + __slots__ = ('_path_helper', '_extmethods', '__tag_type','__priority',) + + _yang_name = 'ethernet-label-range' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tag_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'label-restrictions', 'label-restriction', 'ethernet-label-range'] + + def _get_tag_type(self): + """ + Getter method for tag_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/ethernet_label_range/tag_type (etht-types:eth-tag-type) + + YANG Description: VLAN tag type. + """ + return self.__tag_type + + def _set_tag_type(self, v, load=False): + """ + Setter method for tag_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/ethernet_label_range/tag_type (etht-types:eth-tag-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_tag_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tag_type() directly. + + YANG Description: VLAN tag type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tag_type must be of a type compatible with etht-types:eth-tag-type""", + 'defined-type': "etht-types:eth-tag-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True)""", + }) + + self.__tag_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_tag_type(self): + self.__tag_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/ethernet_label_range/priority (uint8) + + YANG Description: priority. + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/ethernet_label_range/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: priority. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True) + + tag_type = __builtin__.property(_get_tag_type, _set_tag_type) + priority = __builtin__.property(_get_priority, _set_priority) + + + _pyangbind_elements = OrderedDict([('tag_type', tag_type), ('priority', priority), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/__init__.py new file mode 100644 index 000000000..9986d6a93 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/__init__.py @@ -0,0 +1,119 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_end(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/label-restrictions/label-restriction/label-end. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-end' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'label-restrictions', 'label-restriction', 'label-end'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/__init__.py new file mode 100644 index 000000000..29e0c9a99 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/label-restrictions/label-restriction/label-end/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'label-restrictions', 'label-restriction', 'label-end', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/otn (container) + + YANG Description: Label start or label end for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label start or label end for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py new file mode 100644 index 000000000..1970e3999 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/label-restrictions/label-restriction/label-end/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label start or label end for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'label-restrictions', 'label-restriction', 'label-end', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/otn/ts (otn-ts) + + YANG Description: Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_end/te_label/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + ts = __builtin__.property(_get_ts, _set_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/__init__.py new file mode 100644 index 000000000..5d88a1763 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/__init__.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_start(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/label-restrictions/label-restriction/label-start. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-start' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'label-restrictions', 'label-restriction', 'label-start'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/__init__.py new file mode 100644 index 000000000..3a96742a0 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/label-restrictions/label-restriction/label-start/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'label-restrictions', 'label-restriction', 'label-start', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/otn (container) + + YANG Description: Label start or label end for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label start or label end for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py new file mode 100644 index 000000000..8dede38f3 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/label-restrictions/label-restriction/label-start/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label start or label end for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'label-restrictions', 'label-restriction', 'label-start', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/otn/ts (otn-ts) + + YANG Description: Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_start/te_label/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + ts = __builtin__.property(_get_ts, _set_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/__init__.py new file mode 100644 index 000000000..6fefc3147 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/__init__.py @@ -0,0 +1,200 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class label_step(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/label-restrictions/label-restriction/label-step. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_step',) + + _yang_name = 'label-step' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__eth_step = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'label-restrictions', 'label-restriction', 'label-step'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/generic (int32) + + YANG Description: Label range step. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/generic (int32) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Label range step. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with int32""", + 'defined-type': "int32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/otn (container) + + YANG Description: Label step for OTN + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label step for OTN + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_eth_step(self): + """ + Getter method for eth_step, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/eth_step (uint16) + + YANG Description: Label step which represent possible increments for +an Ethernet VLAN tag. + """ + return self.__eth_step + + def _set_eth_step(self, v, load=False): + """ + Setter method for eth_step, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/eth_step (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_step is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_step() directly. + + YANG Description: Label step which represent possible increments for +an Ethernet VLAN tag. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_step must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True)""", + }) + + self.__eth_step = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_step(self): + self.__eth_step = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + eth_step = __builtin__.property(_get_eth_step, _set_eth_step) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['eth_step']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_step', eth_step), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/otn/__init__.py new file mode 100644 index 000000000..a14b27f40 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/otn/__init__.py @@ -0,0 +1,158 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/label-restrictions/label-restriction/label-step/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label step for OTN + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'label-restrictions', 'label-restriction', 'label-step', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/otn/tpn (otn-tpn) + + YANG Description: Label step which represents possible increments for +Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Label step which represents possible increments for +Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/otn/ts (otn-ts) + + YANG Description: Label step which represents possible increments for +Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/label_step/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Label step which represents possible increments for +Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + ts = __builtin__.property(_get_ts, _set_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/__init__.py new file mode 100644 index 000000000..734a4997e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/__init__.py @@ -0,0 +1,256 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn_label_range(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/label-restrictions/label-restriction/otn-label-range. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label range information for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__range_type','__tsg','__odu_type_list','__priority',) + + _yang_name = 'otn-label-range' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__range_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__odu_type_list = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'label-restrictions', 'label-restriction', 'otn-label-range'] + + def _get_range_type(self): + """ + Getter method for range_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/range_type (otn-label-range-type) + + YANG Description: The type of range (e.g., TPN or TS) +to which the label range applies + """ + return self.__range_type + + def _set_range_type(self, v, load=False): + """ + Setter method for range_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/range_type (otn-label-range-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_range_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_range_type() directly. + + YANG Description: The type of range (e.g., TPN or TS) +to which the label range applies + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """range_type must be of a type compatible with otn-label-range-type""", + 'defined-type': "ietf-otn-topology:otn-label-range-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True)""", + }) + + self.__range_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_range_type(self): + self.__range_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/tsg (identityref) + + YANG Description: Tributary slot granularity (TSG) to which the label range +applies. + +This leaf MUST be present when the range-type is TS. + +This leaf MAY be omitted when mapping an ODUk over an OTUk +Link. In this case the range-type is tpn, with only one +entry (ODUk), and the tpn range has only one value (1). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary slot granularity (TSG) to which the label range +applies. + +This leaf MUST be present when the range-type is TS. + +This leaf MAY be omitted when mapping an ODUk over an OTUk +Link. In this case the range-type is tpn, with only one +entry (ODUk), and the tpn range has only one value (1). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_odu_type_list(self): + """ + Getter method for odu_type_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/odu_type_list (identityref) + + YANG Description: List of ODU types to which the label range applies. + +An Empty odu-type-list means that the label range +applies to all the supported ODU types. + """ + return self.__odu_type_list + + def _set_odu_type_list(self, v, load=False): + """ + Setter method for odu_type_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/odu_type_list (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type_list() directly. + + YANG Description: List of ODU types to which the label range applies. + +An Empty odu-type-list means that the label range +applies to all the supported ODU types. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type_list must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__odu_type_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type_list(self): + self.__odu_type_list = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/priority (uint8) + + YANG Description: Priority in Interface Switching Capability +Descriptor (ISCD). + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/label_restrictions/label_restriction/otn_label_range/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: Priority in Interface Switching Capability +Descriptor (ISCD). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True) + + range_type = __builtin__.property(_get_range_type, _set_range_type) + tsg = __builtin__.property(_get_tsg, _set_tsg) + odu_type_list = __builtin__.property(_get_odu_type_list, _set_odu_type_list) + priority = __builtin__.property(_get_priority, _set_priority) + + + _pyangbind_elements = OrderedDict([('range_type', range_type), ('tsg', tsg), ('odu_type_list', odu_type_list), ('priority', priority), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/__init__.py new file mode 100644 index 000000000..a38eef90a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/__init__.py @@ -0,0 +1,199 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import optimization_metric +from . import tiebreakers +from . import objective_function +class optimizations(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + __slots__ = ('_path_helper', '_extmethods', '__optimization_metric','__tiebreakers','__objective_function',) + + _yang_name = 'optimizations' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__optimization_metric = YANGDynClass(base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + self.__tiebreakers = YANGDynClass(base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__objective_function = YANGDynClass(base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations'] + + def _get_optimization_metric(self): + """ + Getter method for optimization_metric, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric (list) + + YANG Description: TE path metric type. + """ + return self.__optimization_metric + + def _set_optimization_metric(self, v, load=False): + """ + Setter method for optimization_metric, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_optimization_metric is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_optimization_metric() directly. + + YANG Description: TE path metric type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """optimization_metric must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__optimization_metric = t + if hasattr(self, '_set'): + self._set() + + def _unset_optimization_metric(self): + self.__optimization_metric = YANGDynClass(base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + + def _get_tiebreakers(self): + """ + Getter method for tiebreakers, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/tiebreakers (container) + + YANG Description: Container for the list of tiebreakers. + """ + return self.__tiebreakers + + def _set_tiebreakers(self, v, load=False): + """ + Setter method for tiebreakers, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/tiebreakers (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tiebreakers is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tiebreakers() directly. + + YANG Description: Container for the list of tiebreakers. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tiebreakers must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__tiebreakers = t + if hasattr(self, '_set'): + self._set() + + def _unset_tiebreakers(self): + self.__tiebreakers = YANGDynClass(base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_objective_function(self): + """ + Getter method for objective_function, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/objective_function (container) + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + return self.__objective_function + + def _set_objective_function(self, v, load=False): + """ + Setter method for objective_function, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/objective_function (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_objective_function is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_objective_function() directly. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """objective_function must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__objective_function = t + if hasattr(self, '_set'): + self._set() + + def _unset_objective_function(self): + self.__objective_function = YANGDynClass(base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + optimization_metric = __builtin__.property(_get_optimization_metric, _set_optimization_metric) + tiebreakers = __builtin__.property(_get_tiebreakers, _set_tiebreakers) + objective_function = __builtin__.property(_get_objective_function, _set_objective_function) + + __choices__ = {'algorithm': {'metric': ['optimization_metric', 'tiebreakers'], 'objective-function': ['objective_function']}} + _pyangbind_elements = OrderedDict([('optimization_metric', optimization_metric), ('tiebreakers', tiebreakers), ('objective_function', objective_function), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/objective_function/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/objective_function/__init__.py new file mode 100644 index 000000000..3938cadf9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/objective_function/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class objective_function(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/objective-function. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + __slots__ = ('_path_helper', '_extmethods', '__objective_function_type',) + + _yang_name = 'objective-function' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__objective_function_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'objective-function'] + + def _get_objective_function_type(self): + """ + Getter method for objective_function_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/objective_function/objective_function_type (identityref) + + YANG Description: Objective function entry. + """ + return self.__objective_function_type + + def _set_objective_function_type(self, v, load=False): + """ + Setter method for objective_function_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/objective_function/objective_function_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_objective_function_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_objective_function_type() directly. + + YANG Description: Objective function entry. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """objective_function_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__objective_function_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_objective_function_type(self): + self.__objective_function_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + objective_function_type = __builtin__.property(_get_objective_function_type, _set_objective_function_type) + + __choices__ = {'algorithm': {'objective-function': ['objective_function_type']}} + _pyangbind_elements = OrderedDict([('objective_function_type', objective_function_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/__init__.py new file mode 100644 index 000000000..8594a8e95 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/__init__.py @@ -0,0 +1,241 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import explicit_route_exclude_objects +from . import explicit_route_include_objects +class optimization_metric(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/optimization-metric. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE path metric type. + """ + __slots__ = ('_path_helper', '_extmethods', '__metric_type','__weight','__explicit_route_exclude_objects','__explicit_route_include_objects',) + + _yang_name = 'optimization-metric' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__weight = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + self.__explicit_route_exclude_objects = YANGDynClass(base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__explicit_route_include_objects = YANGDynClass(base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'optimization-metric'] + + def _get_metric_type(self): + """ + Getter method for metric_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/metric_type (identityref) + + YANG Description: Identifies the 'metric-type' that the path computation +process uses for optimization. + """ + return self.__metric_type + + def _set_metric_type(self, v, load=False): + """ + Setter method for metric_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/metric_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_metric_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_metric_type() directly. + + YANG Description: Identifies the 'metric-type' that the path computation +process uses for optimization. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """metric_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__metric_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_metric_type(self): + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_weight(self): + """ + Getter method for weight, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/weight (uint8) + + YANG Description: TE path metric normalization weight. + """ + return self.__weight + + def _set_weight(self, v, load=False): + """ + Setter method for weight, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/weight (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_weight is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_weight() directly. + + YANG Description: TE path metric normalization weight. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """weight must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__weight = t + if hasattr(self, '_set'): + self._set() + + def _unset_weight(self): + self.__weight = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + + + def _get_explicit_route_exclude_objects(self): + """ + Getter method for explicit_route_exclude_objects, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects (container) + + YANG Description: Container for the 'exclude route' object list. + """ + return self.__explicit_route_exclude_objects + + def _set_explicit_route_exclude_objects(self, v, load=False): + """ + Setter method for explicit_route_exclude_objects, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_explicit_route_exclude_objects is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_explicit_route_exclude_objects() directly. + + YANG Description: Container for the 'exclude route' object list. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """explicit_route_exclude_objects must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__explicit_route_exclude_objects = t + if hasattr(self, '_set'): + self._set() + + def _unset_explicit_route_exclude_objects(self): + self.__explicit_route_exclude_objects = YANGDynClass(base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_explicit_route_include_objects(self): + """ + Getter method for explicit_route_include_objects, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects (container) + + YANG Description: Container for the 'include route' object list. + """ + return self.__explicit_route_include_objects + + def _set_explicit_route_include_objects(self, v, load=False): + """ + Setter method for explicit_route_include_objects, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_explicit_route_include_objects is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_explicit_route_include_objects() directly. + + YANG Description: Container for the 'include route' object list. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """explicit_route_include_objects must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__explicit_route_include_objects = t + if hasattr(self, '_set'): + self._set() + + def _unset_explicit_route_include_objects(self): + self.__explicit_route_include_objects = YANGDynClass(base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + metric_type = __builtin__.property(_get_metric_type, _set_metric_type) + weight = __builtin__.property(_get_weight, _set_weight) + explicit_route_exclude_objects = __builtin__.property(_get_explicit_route_exclude_objects, _set_explicit_route_exclude_objects) + explicit_route_include_objects = __builtin__.property(_get_explicit_route_include_objects, _set_explicit_route_include_objects) + + __choices__ = {'algorithm': {'metric': ['metric_type', 'weight', 'explicit_route_exclude_objects', 'explicit_route_include_objects']}} + _pyangbind_elements = OrderedDict([('metric_type', metric_type), ('weight', weight), ('explicit_route_exclude_objects', explicit_route_exclude_objects), ('explicit_route_include_objects', explicit_route_include_objects), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/__init__.py new file mode 100644 index 000000000..d96148db3 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import route_object_exclude_object +class explicit_route_exclude_objects(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/optimization-metric/explicit-route-exclude-objects. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the 'exclude route' object list. + """ + __slots__ = ('_path_helper', '_extmethods', '__route_object_exclude_object',) + + _yang_name = 'explicit-route-exclude-objects' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__route_object_exclude_object = YANGDynClass(base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects'] + + def _get_route_object_exclude_object(self): + """ + Getter method for route_object_exclude_object, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object (list) + + YANG Description: List of Explicit Route Objects to be excluded in the +path computation. + """ + return self.__route_object_exclude_object + + def _set_route_object_exclude_object(self, v, load=False): + """ + Setter method for route_object_exclude_object, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_route_object_exclude_object is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_route_object_exclude_object() directly. + + YANG Description: List of Explicit Route Objects to be excluded in the +path computation. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """route_object_exclude_object must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__route_object_exclude_object = t + if hasattr(self, '_set'): + self._set() + + def _unset_route_object_exclude_object(self): + self.__route_object_exclude_object = YANGDynClass(base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + route_object_exclude_object = __builtin__.property(_get_route_object_exclude_object, _set_route_object_exclude_object) + + __choices__ = {'algorithm': {'metric': ['route_object_exclude_object']}} + _pyangbind_elements = OrderedDict([('route_object_exclude_object', route_object_exclude_object), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py new file mode 100644 index 000000000..be837bdc1 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py @@ -0,0 +1,365 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +from . import srlg +class route_object_exclude_object(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of Explicit Route Objects to be excluded in the +path computation. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop','__srlg',) + + _yang_name = 'route-object-exclude-object' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__srlg = YANGDynClass(base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/index (uint32) + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/index (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_srlg(self): + """ + Getter method for srlg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg (container) + + YANG Description: SRLG container. + """ + return self.__srlg + + def _set_srlg(self, v, load=False): + """ + Setter method for srlg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_srlg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_srlg() directly. + + YANG Description: SRLG container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """srlg must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__srlg = t + if hasattr(self, '_set'): + self._set() + + def _unset_srlg(self): + self.__srlg = YANGDynClass(base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + index = __builtin__.property(_get_index, _set_index) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop, _set_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop, _set_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop, _set_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop, _set_as_number_hop) + label_hop = __builtin__.property(_get_label_hop, _set_label_hop) + srlg = __builtin__.property(_get_srlg, _set_srlg) + + __choices__ = {'algorithm': {'metric': ['index']}, 'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop'], 'srlg': ['srlg']}} + _pyangbind_elements = OrderedDict([('index', index), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ('srlg', srlg), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/__init__.py new file mode 100644 index 000000000..1e6791351 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + as_number = __builtin__.property(_get_as_number, _set_as_number) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/__init__.py new file mode 100644 index 000000000..50003dc6a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/__init__.py new file mode 100644 index 000000000..b80329a9f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/__init__.py new file mode 100644 index 000000000..56737e865 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + tsg = __builtin__.property(_get_tsg, _set_tsg) + ts_list = __builtin__.property(_get_ts_list, _set_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/__init__.py new file mode 100644 index 000000000..c91d34b8b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/__init__.py new file mode 100644 index 000000000..e9805bcdf --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/__init__.py new file mode 100644 index 000000000..c5c2961e6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/__init__.py @@ -0,0 +1,115 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class srlg(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/srlg. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: SRLG container. + """ + __slots__ = ('_path_helper', '_extmethods', '__srlg',) + + _yang_name = 'srlg' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__srlg = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'srlg'] + + def _get_srlg(self): + """ + Getter method for srlg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/srlg (uint32) + + YANG Description: SRLG value. + """ + return self.__srlg + + def _set_srlg(self, v, load=False): + """ + Setter method for srlg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/srlg (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_srlg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_srlg() directly. + + YANG Description: SRLG value. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """srlg must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__srlg = t + if hasattr(self, '_set'): + self._set() + + def _unset_srlg(self): + self.__srlg = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + srlg = __builtin__.property(_get_srlg, _set_srlg) + + __choices__ = {'type': {'srlg': ['srlg']}} + _pyangbind_elements = OrderedDict([('srlg', srlg), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/__init__.py new file mode 100644 index 000000000..4a5b91f1c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/__init__.py new file mode 100644 index 000000000..52d91329d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import route_object_include_object +class explicit_route_include_objects(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/optimization-metric/explicit-route-include-objects. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the 'include route' object list. + """ + __slots__ = ('_path_helper', '_extmethods', '__route_object_include_object',) + + _yang_name = 'explicit-route-include-objects' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__route_object_include_object = YANGDynClass(base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-include-objects'] + + def _get_route_object_include_object(self): + """ + Getter method for route_object_include_object, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object (list) + + YANG Description: List of Explicit Route Objects to be included in the +path computation. + """ + return self.__route_object_include_object + + def _set_route_object_include_object(self, v, load=False): + """ + Setter method for route_object_include_object, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_route_object_include_object is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_route_object_include_object() directly. + + YANG Description: List of Explicit Route Objects to be included in the +path computation. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """route_object_include_object must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__route_object_include_object = t + if hasattr(self, '_set'): + self._set() + + def _unset_route_object_include_object(self): + self.__route_object_include_object = YANGDynClass(base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + route_object_include_object = __builtin__.property(_get_route_object_include_object, _set_route_object_include_object) + + __choices__ = {'algorithm': {'metric': ['route_object_include_object']}} + _pyangbind_elements = OrderedDict([('route_object_include_object', route_object_include_object), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py new file mode 100644 index 000000000..4b596318d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py @@ -0,0 +1,325 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class route_object_include_object(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of Explicit Route Objects to be included in the +path computation. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'route-object-include-object' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/index (uint32) + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/index (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + index = __builtin__.property(_get_index, _set_index) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop, _set_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop, _set_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop, _set_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop, _set_as_number_hop) + label_hop = __builtin__.property(_get_label_hop, _set_label_hop) + + __choices__ = {'algorithm': {'metric': ['index']}, 'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('index', index), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/__init__.py new file mode 100644 index 000000000..005900b6d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + as_number = __builtin__.property(_get_as_number, _set_as_number) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/__init__.py new file mode 100644 index 000000000..cec600652 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/__init__.py new file mode 100644 index 000000000..5212e8f5d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/__init__.py new file mode 100644 index 000000000..de434357d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + tsg = __builtin__.property(_get_tsg, _set_tsg) + ts_list = __builtin__.property(_get_ts_list, _set_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/__init__.py new file mode 100644 index 000000000..a4d2fdce1 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/__init__.py new file mode 100644 index 000000000..d5f6b873c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/__init__.py new file mode 100644 index 000000000..b3cc0d8de --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/tiebreakers/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/tiebreakers/__init__.py new file mode 100644 index 000000000..1132534b5 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/tiebreakers/__init__.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import tiebreaker +class tiebreakers(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/tiebreakers. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of tiebreakers. + """ + __slots__ = ('_path_helper', '_extmethods', '__tiebreaker',) + + _yang_name = 'tiebreakers' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tiebreaker = YANGDynClass(base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'tiebreakers'] + + def _get_tiebreaker(self): + """ + Getter method for tiebreaker, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/tiebreakers/tiebreaker (list) + + YANG Description: The list of tiebreaker criteria to apply on an +equally favored set of paths, in order to pick +the best. + """ + return self.__tiebreaker + + def _set_tiebreaker(self, v, load=False): + """ + Setter method for tiebreaker, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/tiebreakers/tiebreaker (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_tiebreaker is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tiebreaker() directly. + + YANG Description: The list of tiebreaker criteria to apply on an +equally favored set of paths, in order to pick +the best. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tiebreaker must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__tiebreaker = t + if hasattr(self, '_set'): + self._set() + + def _unset_tiebreaker(self): + self.__tiebreaker = YANGDynClass(base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + tiebreaker = __builtin__.property(_get_tiebreaker, _set_tiebreaker) + + __choices__ = {'algorithm': {'metric': ['tiebreaker']}} + _pyangbind_elements = OrderedDict([('tiebreaker', tiebreaker), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/tiebreakers/tiebreaker/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/tiebreakers/tiebreaker/__init__.py new file mode 100644 index 000000000..41f4df7a2 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/tiebreakers/tiebreaker/__init__.py @@ -0,0 +1,122 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class tiebreaker(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/optimizations/tiebreakers/tiebreaker. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The list of tiebreaker criteria to apply on an +equally favored set of paths, in order to pick +the best. + """ + __slots__ = ('_path_helper', '_extmethods', '__tiebreaker_type',) + + _yang_name = 'tiebreaker' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tiebreaker_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'optimizations', 'tiebreakers', 'tiebreaker'] + + def _get_tiebreaker_type(self): + """ + Getter method for tiebreaker_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/tiebreakers/tiebreaker/tiebreaker_type (identityref) + + YANG Description: Identifies an entry in the list of tiebreakers. + """ + return self.__tiebreaker_type + + def _set_tiebreaker_type(self, v, load=False): + """ + Setter method for tiebreaker_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/optimizations/tiebreakers/tiebreaker/tiebreaker_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tiebreaker_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tiebreaker_type() directly. + + YANG Description: Identifies an entry in the list of tiebreakers. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tiebreaker_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tiebreaker_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_tiebreaker_type(self): + self.__tiebreaker_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + tiebreaker_type = __builtin__.property(_get_tiebreaker_type, _set_tiebreaker_type) + + __choices__ = {'algorithm': {'metric': ['tiebreaker_type']}} + _pyangbind_elements = OrderedDict([('tiebreaker_type', tiebreaker_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/__init__.py new file mode 100644 index 000000000..f8f93bf02 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/__init__.py @@ -0,0 +1,523 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_bandwidth +from . import path_metric_bounds +from . import path_affinities_values +from . import path_affinity_names +from . import path_srlgs_lists +from . import path_srlgs_names +class path_constraints(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-constraints. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE named path constraints container. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_bandwidth','__link_protection','__setup_priority','__hold_priority','__signaling_type','__path_metric_bounds','__path_affinities_values','__path_affinity_names','__path_srlgs_lists','__path_srlgs_names','__disjointness',) + + _yang_name = 'path-constraints' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__link_protection = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__setup_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + self.__hold_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + self.__signaling_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__path_metric_bounds = YANGDynClass(base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__disjointness = YANGDynClass(base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-constraints'] + + def _get_te_bandwidth(self): + """ + Getter method for te_bandwidth, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth (container) + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + return self.__te_bandwidth + + def _set_te_bandwidth(self, v, load=False): + """ + Setter method for te_bandwidth, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_bandwidth() directly. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_bandwidth(self): + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_link_protection(self): + """ + Getter method for link_protection, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/link_protection (identityref) + + YANG Description: Link protection type required for the links included +in the computed path. + """ + return self.__link_protection + + def _set_link_protection(self, v, load=False): + """ + Setter method for link_protection, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/link_protection (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_protection is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_protection() directly. + + YANG Description: Link protection type required for the links included +in the computed path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_protection must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__link_protection = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_protection(self): + self.__link_protection = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_setup_priority(self): + """ + Getter method for setup_priority, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/setup_priority (uint8) + + YANG Description: TE LSP requested setup priority. + """ + return self.__setup_priority + + def _set_setup_priority(self, v, load=False): + """ + Setter method for setup_priority, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/setup_priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_setup_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_setup_priority() directly. + + YANG Description: TE LSP requested setup priority. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """setup_priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__setup_priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_setup_priority(self): + self.__setup_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + + + def _get_hold_priority(self): + """ + Getter method for hold_priority, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/hold_priority (uint8) + + YANG Description: TE LSP requested hold priority. + """ + return self.__hold_priority + + def _set_hold_priority(self, v, load=False): + """ + Setter method for hold_priority, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/hold_priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_hold_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hold_priority() directly. + + YANG Description: TE LSP requested hold priority. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hold_priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__hold_priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_hold_priority(self): + self.__hold_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + + + def _get_signaling_type(self): + """ + Getter method for signaling_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/signaling_type (identityref) + + YANG Description: TE tunnel path signaling type. + """ + return self.__signaling_type + + def _set_signaling_type(self, v, load=False): + """ + Setter method for signaling_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/signaling_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_signaling_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_signaling_type() directly. + + YANG Description: TE tunnel path signaling type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """signaling_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__signaling_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_signaling_type(self): + self.__signaling_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_path_metric_bounds(self): + """ + Getter method for path_metric_bounds, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_metric_bounds (container) + + YANG Description: TE path metric bounds container. + """ + return self.__path_metric_bounds + + def _set_path_metric_bounds(self, v, load=False): + """ + Setter method for path_metric_bounds, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_metric_bounds (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_metric_bounds is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_metric_bounds() directly. + + YANG Description: TE path metric bounds container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_metric_bounds must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_metric_bounds = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_metric_bounds(self): + self.__path_metric_bounds = YANGDynClass(base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_affinities_values(self): + """ + Getter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinities_values (container) + + YANG Description: Path affinities represented as values. + """ + return self.__path_affinities_values + + def _set_path_affinities_values(self, v, load=False): + """ + Setter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinities_values (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_values() directly. + + YANG Description: Path affinities represented as values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_values must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_affinities_values = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_values(self): + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_affinity_names(self): + """ + Getter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names (container) + + YANG Description: Path affinities represented as names. + """ + return self.__path_affinity_names + + def _set_path_affinity_names(self, v, load=False): + """ + Setter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_names() directly. + + YANG Description: Path affinities represented as names. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_affinity_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_names(self): + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_srlgs_lists(self): + """ + Getter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_lists (container) + + YANG Description: Path SRLG properties container. + """ + return self.__path_srlgs_lists + + def _set_path_srlgs_lists(self, v, load=False): + """ + Setter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_lists (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_lists is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_lists() directly. + + YANG Description: Path SRLG properties container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_lists must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_srlgs_lists = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_lists(self): + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_srlgs_names(self): + """ + Getter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_names (container) + + YANG Description: Container for the list of named SRLGs. + """ + return self.__path_srlgs_names + + def _set_path_srlgs_names(self, v, load=False): + """ + Setter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_names() directly. + + YANG Description: Container for the list of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_srlgs_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_names(self): + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_disjointness(self): + """ + Getter method for disjointness, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/disjointness (te-path-disjointness) + + YANG Description: The type of resource disjointness. +When configured for a primary path, the disjointness level +applies to all secondary LSPs. When configured for a +secondary path, the disjointness level overrides the level +configured for the primary path. + """ + return self.__disjointness + + def _set_disjointness(self, v, load=False): + """ + Setter method for disjointness, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/disjointness (te-path-disjointness) + If this variable is read-only (config: false) in the + source YANG file, then _set_disjointness is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_disjointness() directly. + + YANG Description: The type of resource disjointness. +When configured for a primary path, the disjointness level +applies to all secondary LSPs. When configured for a +secondary path, the disjointness level overrides the level +configured for the primary path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """disjointness must be of a type compatible with te-path-disjointness""", + 'defined-type': "ietf-te-topology:te-path-disjointness", + 'generated-type': """YANGDynClass(base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', is_config=True)""", + }) + + self.__disjointness = t + if hasattr(self, '_set'): + self._set() + + def _unset_disjointness(self): + self.__disjointness = YANGDynClass(base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', is_config=True) + + te_bandwidth = __builtin__.property(_get_te_bandwidth, _set_te_bandwidth) + link_protection = __builtin__.property(_get_link_protection, _set_link_protection) + setup_priority = __builtin__.property(_get_setup_priority, _set_setup_priority) + hold_priority = __builtin__.property(_get_hold_priority, _set_hold_priority) + signaling_type = __builtin__.property(_get_signaling_type, _set_signaling_type) + path_metric_bounds = __builtin__.property(_get_path_metric_bounds, _set_path_metric_bounds) + path_affinities_values = __builtin__.property(_get_path_affinities_values, _set_path_affinities_values) + path_affinity_names = __builtin__.property(_get_path_affinity_names, _set_path_affinity_names) + path_srlgs_lists = __builtin__.property(_get_path_srlgs_lists, _set_path_srlgs_lists) + path_srlgs_names = __builtin__.property(_get_path_srlgs_names, _set_path_srlgs_names) + disjointness = __builtin__.property(_get_disjointness, _set_disjointness) + + + _pyangbind_elements = OrderedDict([('te_bandwidth', te_bandwidth), ('link_protection', link_protection), ('setup_priority', setup_priority), ('hold_priority', hold_priority), ('signaling_type', signaling_type), ('path_metric_bounds', path_metric_bounds), ('path_affinities_values', path_affinities_values), ('path_affinity_names', path_affinity_names), ('path_srlgs_lists', path_srlgs_lists), ('path_srlgs_names', path_srlgs_names), ('disjointness', disjointness), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinities_values/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinities_values/__init__.py new file mode 100644 index 000000000..b04586e5a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinities_values/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_affinities_value +class path_affinities_values(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-constraints/path-affinities-values. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as values. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinities_value',) + + _yang_name = 'path-affinities-values' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-constraints', 'path-affinities-values'] + + def _get_path_affinities_value(self): + """ + Getter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinities_value + + def _set_path_affinities_value(self, v, load=False): + """ + Setter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_value() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_value must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_affinities_value = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_value(self): + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + path_affinities_value = __builtin__.property(_get_path_affinities_value, _set_path_affinities_value) + + + _pyangbind_elements = OrderedDict([('path_affinities_value', path_affinities_value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value/__init__.py new file mode 100644 index 000000000..d4347e12e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value/__init__.py @@ -0,0 +1,161 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_affinities_value(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-constraints/path-affinities-values/path-affinities-value. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__value',) + + _yang_name = 'path-affinities-value' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-constraints', 'path-affinities-values', 'path-affinities-value'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value/usage (identityref) + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_value(self): + """ + Getter method for value, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value/value (admin-groups) + + YANG Description: The affinity value. The default is empty. + """ + return self.__value + + def _set_value(self, v, load=False): + """ + Setter method for value, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinities_values/path_affinities_value/value (admin-groups) + If this variable is read-only (config: false) in the + source YANG file, then _set_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_value() directly. + + YANG Description: The affinity value. The default is empty. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """value must be of a type compatible with admin-groups""", + 'defined-type': "ietf-te-topology:admin-groups", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=True)""", + }) + + self.__value = t + if hasattr(self, '_set'): + self._set() + + def _unset_value(self): + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=True) + + usage = __builtin__.property(_get_usage, _set_usage) + value = __builtin__.property(_get_value, _set_value) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('value', value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/__init__.py new file mode 100644 index 000000000..d9511703b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_affinity_name +class path_affinity_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-constraints/path-affinity-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as names. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinity_name',) + + _yang_name = 'path-affinity-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-constraints', 'path-affinity-names'] + + def _get_path_affinity_name(self): + """ + Getter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinity_name + + def _set_path_affinity_name(self, v, load=False): + """ + Setter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_name() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_name(self): + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + path_affinity_name = __builtin__.property(_get_path_affinity_name, _set_path_affinity_name) + + + _pyangbind_elements = OrderedDict([('path_affinity_name', path_affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/__init__.py new file mode 100644 index 000000000..5bea16d3c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/__init__.py @@ -0,0 +1,162 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import affinity_name +class path_affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-constraints/path-affinity-names/path-affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__affinity_name',) + + _yang_name = 'path-affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-constraints', 'path-affinity-names', 'path-affinity-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/usage (identityref) + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_affinity_name(self): + """ + Getter method for affinity_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/affinity_name (list) + + YANG Description: List of named affinities. + """ + return self.__affinity_name + + def _set_affinity_name(self, v, load=False): + """ + Setter method for affinity_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_affinity_name() directly. + + YANG Description: List of named affinities. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_affinity_name(self): + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + usage = __builtin__.property(_get_usage, _set_usage) + affinity_name = __builtin__.property(_get_affinity_name, _set_affinity_name) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('affinity_name', affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py new file mode 100644 index 000000000..27b87f524 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-constraints/path-affinity-names/path-affinity-name/affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinities. + """ + __slots__ = ('_path_helper', '_extmethods', '__name',) + + _yang_name = 'affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-constraints', 'path-affinity-names', 'path-affinity-name', 'affinity-name'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/affinity_name/name (string) + + YANG Description: Identifies a named affinity entry. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_affinity_names/path_affinity_name/affinity_name/name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: Identifies a named affinity entry. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + name = __builtin__.property(_get_name, _set_name) + + + _pyangbind_elements = OrderedDict([('name', name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_metric_bounds/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_metric_bounds/__init__.py new file mode 100644 index 000000000..89e9dcde5 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_metric_bounds/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_metric_bound +class path_metric_bounds(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-constraints/path-metric-bounds. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE path metric bounds container. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_metric_bound',) + + _yang_name = 'path-metric-bounds' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_metric_bound = YANGDynClass(base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-constraints', 'path-metric-bounds'] + + def _get_path_metric_bound(self): + """ + Getter method for path_metric_bound, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound (list) + + YANG Description: List of TE path metric bounds. + """ + return self.__path_metric_bound + + def _set_path_metric_bound(self, v, load=False): + """ + Setter method for path_metric_bound, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_metric_bound is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_metric_bound() directly. + + YANG Description: List of TE path metric bounds. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_metric_bound must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_metric_bound = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_metric_bound(self): + self.__path_metric_bound = YANGDynClass(base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + path_metric_bound = __builtin__.property(_get_path_metric_bound, _set_path_metric_bound) + + + _pyangbind_elements = OrderedDict([('path_metric_bound', path_metric_bound), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound/__init__.py new file mode 100644 index 000000000..9e967408a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound/__init__.py @@ -0,0 +1,165 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_metric_bound(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-constraints/path-metric-bounds/path-metric-bound. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of TE path metric bounds. + """ + __slots__ = ('_path_helper', '_extmethods', '__metric_type','__upper_bound',) + + _yang_name = 'path-metric-bound' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__upper_bound = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-constraints', 'path-metric-bounds', 'path-metric-bound'] + + def _get_metric_type(self): + """ + Getter method for metric_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound/metric_type (identityref) + + YANG Description: Identifies an entry in the list of 'metric-type' items +bound for the TE path. + """ + return self.__metric_type + + def _set_metric_type(self, v, load=False): + """ + Setter method for metric_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound/metric_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_metric_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_metric_type() directly. + + YANG Description: Identifies an entry in the list of 'metric-type' items +bound for the TE path. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """metric_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__metric_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_metric_type(self): + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_upper_bound(self): + """ + Getter method for upper_bound, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound/upper_bound (uint64) + + YANG Description: Upper bound on the end-to-end TE path metric. A zero +indicates an unbounded upper limit for the specific +'metric-type'. + """ + return self.__upper_bound + + def _set_upper_bound(self, v, load=False): + """ + Setter method for upper_bound, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_metric_bounds/path_metric_bound/upper_bound (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_upper_bound is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_upper_bound() directly. + + YANG Description: Upper bound on the end-to-end TE path metric. A zero +indicates an unbounded upper limit for the specific +'metric-type'. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """upper_bound must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__upper_bound = t + if hasattr(self, '_set'): + self._set() + + def _unset_upper_bound(self): + self.__upper_bound = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=True) + + metric_type = __builtin__.property(_get_metric_type, _set_metric_type) + upper_bound = __builtin__.property(_get_upper_bound, _set_upper_bound) + + + _pyangbind_elements = OrderedDict([('metric_type', metric_type), ('upper_bound', upper_bound), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_lists/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_lists/__init__.py new file mode 100644 index 000000000..4a3633c28 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_lists/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_srlgs_list +class path_srlgs_lists(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-constraints/path-srlgs-lists. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path SRLG properties container. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_list',) + + _yang_name = 'path-srlgs-lists' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-constraints', 'path-srlgs-lists'] + + def _get_path_srlgs_list(self): + """ + Getter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list (list) + + YANG Description: List of SRLG values to be included or excluded. + """ + return self.__path_srlgs_list + + def _set_path_srlgs_list(self, v, load=False): + """ + Setter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_list() directly. + + YANG Description: List of SRLG values to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_list must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_srlgs_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_list(self): + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + path_srlgs_list = __builtin__.property(_get_path_srlgs_list, _set_path_srlgs_list) + + + _pyangbind_elements = OrderedDict([('path_srlgs_list', path_srlgs_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py new file mode 100644 index 000000000..25eecfaa4 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py @@ -0,0 +1,161 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_srlgs_list(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-constraints/path-srlgs-lists/path-srlgs-list. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of SRLG values to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__values',) + + _yang_name = 'path-srlgs-list' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-constraints', 'path-srlgs-lists', 'path-srlgs-list'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list/usage (identityref) + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_values(self): + """ + Getter method for values, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list/values (srlg) + + YANG Description: List of SRLG values. + """ + return self.__values + + def _set_values(self, v, load=False): + """ + Setter method for values, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_lists/path_srlgs_list/values (srlg) + If this variable is read-only (config: false) in the + source YANG file, then _set_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_values() directly. + + YANG Description: List of SRLG values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """values must be of a type compatible with srlg""", + 'defined-type': "ietf-te-topology:srlg", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=True)""", + }) + + self.__values = t + if hasattr(self, '_set'): + self._set() + + def _unset_values(self): + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=True) + + usage = __builtin__.property(_get_usage, _set_usage) + values = __builtin__.property(_get_values, _set_values) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('values', values), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_names/__init__.py new file mode 100644 index 000000000..d26858176 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_names/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_srlgs_name +class path_srlgs_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-constraints/path-srlgs-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of named SRLGs. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_name',) + + _yang_name = 'path-srlgs-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-constraints', 'path-srlgs-names'] + + def _get_path_srlgs_name(self): + """ + Getter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name (list) + + YANG Description: List of named SRLGs to be included or excluded. + """ + return self.__path_srlgs_name + + def _set_path_srlgs_name(self, v, load=False): + """ + Setter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_name() directly. + + YANG Description: List of named SRLGs to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_srlgs_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_name(self): + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + path_srlgs_name = __builtin__.property(_get_path_srlgs_name, _set_path_srlgs_name) + + + _pyangbind_elements = OrderedDict([('path_srlgs_name', path_srlgs_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py new file mode 100644 index 000000000..305a401ae --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py @@ -0,0 +1,161 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_srlgs_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-constraints/path-srlgs-names/path-srlgs-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named SRLGs to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__names',) + + _yang_name = 'path-srlgs-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-constraints', 'path-srlgs-names', 'path-srlgs-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name/usage (identityref) + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_names(self): + """ + Getter method for names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name/names (string) + + YANG Description: List of named SRLGs. + """ + return self.__names + + def _set_names(self, v, load=False): + """ + Setter method for names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/path_srlgs_names/path_srlgs_name/names (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_names() directly. + + YANG Description: List of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """names must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True)""", + }) + + self.__names = t + if hasattr(self, '_set'): + self._set() + + def _unset_names(self): + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + usage = __builtin__.property(_get_usage, _set_usage) + names = __builtin__.property(_get_names, _set_names) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('names', names), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/__init__.py new file mode 100644 index 000000000..040c69e2f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/__init__.py @@ -0,0 +1,195 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-constraints/te-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_bandwidth',) + + _yang_name = 'te-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-constraints', 'te-bandwidth'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/generic (te-bandwidth) + + YANG Description: Bandwidth specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/generic (te-bandwidth) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Bandwidth specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with te-bandwidth""", + 'defined-type': "ietf-te-topology:te-bandwidth", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/otn (container) + + YANG Description: Bandwidth attributes for OTN links + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Bandwidth attributes for OTN links + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_eth_bandwidth(self): + """ + Getter method for eth_bandwidth, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/eth_bandwidth (uint64) + + YANG Description: Available bandwith value expressed in kilobits per second + """ + return self.__eth_bandwidth + + def _set_eth_bandwidth(self, v, load=False): + """ + Setter method for eth_bandwidth, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/eth_bandwidth (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_bandwidth() directly. + + YANG Description: Available bandwith value expressed in kilobits per second + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_bandwidth must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__eth_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_bandwidth(self): + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + eth_bandwidth = __builtin__.property(_get_eth_bandwidth, _set_eth_bandwidth) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['eth_bandwidth']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_bandwidth', eth_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/otn/__init__.py new file mode 100644 index 000000000..a1d6ad917 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/otn/__init__.py @@ -0,0 +1,163 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import odulist +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-constraints/te-bandwidth/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Bandwidth attributes for OTN links + """ + __slots__ = ('_path_helper', '_extmethods', '__odulist','__odtu_flex_type',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + self.__odtu_flex_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-constraints', 'te-bandwidth', 'otn'] + + def _get_odulist(self): + """ + Getter method for odulist, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist (list) + + YANG Description: OTN bandwidth definition + """ + return self.__odulist + + def _set_odulist(self, v, load=False): + """ + Setter method for odulist, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_odulist is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odulist() directly. + + YANG Description: OTN bandwidth definition + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odulist must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True)""", + }) + + self.__odulist = t + if hasattr(self, '_set'): + self._set() + + def _unset_odulist(self): + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + + + def _get_odtu_flex_type(self): + """ + Getter method for odtu_flex_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/otn/odtu_flex_type (l1-types:odtu-flex-type) + + YANG Description: The type of Optical Data Tributary Unit (ODTU) +whose nominal bitrate is used to compute the number of +Tributary Slots (TS) required by the ODUflex LSPs +set up along the underlay paths of these OTN +connectivity matrices. + """ + return self.__odtu_flex_type + + def _set_odtu_flex_type(self, v, load=False): + """ + Setter method for odtu_flex_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/otn/odtu_flex_type (l1-types:odtu-flex-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_odtu_flex_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odtu_flex_type() directly. + + YANG Description: The type of Optical Data Tributary Unit (ODTU) +whose nominal bitrate is used to compute the number of +Tributary Slots (TS) required by the ODUflex LSPs +set up along the underlay paths of these OTN +connectivity matrices. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odtu_flex_type must be of a type compatible with l1-types:odtu-flex-type""", + 'defined-type': "l1-types:odtu-flex-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True)""", + }) + + self.__odtu_flex_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odtu_flex_type(self): + self.__odtu_flex_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True) + + odulist = __builtin__.property(_get_odulist, _set_odulist) + odtu_flex_type = __builtin__.property(_get_odtu_flex_type, _set_odtu_flex_type) + + __choices__ = {'technology': {'otn': ['odulist', 'odtu_flex_type']}} + _pyangbind_elements = OrderedDict([('odulist', odulist), ('odtu_flex_type', odtu_flex_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist/__init__.py new file mode 100644 index 000000000..c6577089c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist/__init__.py @@ -0,0 +1,200 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class odulist(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-constraints/te-bandwidth/otn/odulist. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: OTN bandwidth definition + """ + __slots__ = ('_path_helper', '_extmethods', '__odu_type','__number','__ts_number',) + + _yang_name = 'odulist' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-constraints', 'te-bandwidth', 'otn', 'odulist'] + + def _get_odu_type(self): + """ + Getter method for odu_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist/odu_type (identityref) + + YANG Description: ODU type + """ + return self.__odu_type + + def _set_odu_type(self, v, load=False): + """ + Setter method for odu_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist/odu_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type() directly. + + YANG Description: ODU type + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__odu_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type(self): + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_number(self): + """ + Getter method for number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist/number (uint16) + + YANG Description: Number of ODUs + """ + return self.__number + + def _set_number(self, v, load=False): + """ + Setter method for number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist/number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_number() directly. + + YANG Description: Number of ODUs + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__number = t + if hasattr(self, '_set'): + self._set() + + def _unset_number(self): + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + + def _get_ts_number(self): + """ + Getter method for ts_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist/ts_number (uint16) + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + return self.__ts_number + + def _set_ts_number(self, v, load=False): + """ + Setter method for ts_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_constraints/te_bandwidth/otn/odulist/ts_number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_number() directly. + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__ts_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_number(self): + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + odu_type = __builtin__.property(_get_odu_type, _set_odu_type) + number = __builtin__.property(_get_number, _set_number) + ts_number = __builtin__.property(_get_ts_number, _set_ts_number) + + __choices__ = {'technology': {'otn': ['odu_type', 'number', 'ts_number']}} + _pyangbind_elements = OrderedDict([('odu_type', odu_type), ('number', number), ('ts_number', ts_number), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/__init__.py new file mode 100644 index 000000000..5633ecb2d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/__init__.py @@ -0,0 +1,318 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_metric +from . import path_affinities_values +from . import path_affinity_names +from . import path_srlgs_lists +from . import path_srlgs_names +from . import path_route_objects +class path_properties(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-properties. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The TE path properties. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_metric','__path_affinities_values','__path_affinity_names','__path_srlgs_lists','__path_srlgs_names','__path_route_objects',) + + _yang_name = 'path-properties' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_metric = YANGDynClass(base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_route_objects = YANGDynClass(base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-properties'] + + def _get_path_metric(self): + """ + Getter method for path_metric, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_metric (list) + + YANG Description: TE path metric type. + """ + return self.__path_metric + + def _set_path_metric(self, v, load=False): + """ + Setter method for path_metric, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_metric (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_metric is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_metric() directly. + + YANG Description: TE path metric type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_metric must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_metric = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_metric(self): + self.__path_metric = YANGDynClass(base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + + def _get_path_affinities_values(self): + """ + Getter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinities_values (container) + + YANG Description: Path affinities represented as values. + """ + return self.__path_affinities_values + + def _set_path_affinities_values(self, v, load=False): + """ + Setter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinities_values (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_values() directly. + + YANG Description: Path affinities represented as values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_values must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_affinities_values = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_values(self): + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_affinity_names(self): + """ + Getter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names (container) + + YANG Description: Path affinities represented as names. + """ + return self.__path_affinity_names + + def _set_path_affinity_names(self, v, load=False): + """ + Setter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_names() directly. + + YANG Description: Path affinities represented as names. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_affinity_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_names(self): + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_srlgs_lists(self): + """ + Getter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_lists (container) + + YANG Description: Path SRLG properties container. + """ + return self.__path_srlgs_lists + + def _set_path_srlgs_lists(self, v, load=False): + """ + Setter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_lists (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_lists is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_lists() directly. + + YANG Description: Path SRLG properties container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_lists must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_srlgs_lists = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_lists(self): + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_srlgs_names(self): + """ + Getter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_names (container) + + YANG Description: Container for the list of named SRLGs. + """ + return self.__path_srlgs_names + + def _set_path_srlgs_names(self, v, load=False): + """ + Setter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_names() directly. + + YANG Description: Container for the list of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_srlgs_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_names(self): + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_route_objects(self): + """ + Getter method for path_route_objects, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects (container) + + YANG Description: Container for the list of route objects either returned by +the computation engine or actually used by an LSP. + """ + return self.__path_route_objects + + def _set_path_route_objects(self, v, load=False): + """ + Setter method for path_route_objects, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_route_objects is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_route_objects() directly. + + YANG Description: Container for the list of route objects either returned by +the computation engine or actually used by an LSP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_route_objects must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_route_objects = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_route_objects(self): + self.__path_route_objects = YANGDynClass(base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + path_metric = __builtin__.property(_get_path_metric) + path_affinities_values = __builtin__.property(_get_path_affinities_values) + path_affinity_names = __builtin__.property(_get_path_affinity_names) + path_srlgs_lists = __builtin__.property(_get_path_srlgs_lists) + path_srlgs_names = __builtin__.property(_get_path_srlgs_names) + path_route_objects = __builtin__.property(_get_path_route_objects) + + + _pyangbind_elements = OrderedDict([('path_metric', path_metric), ('path_affinities_values', path_affinities_values), ('path_affinity_names', path_affinity_names), ('path_srlgs_lists', path_srlgs_lists), ('path_srlgs_names', path_srlgs_names), ('path_route_objects', path_route_objects), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinities_values/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinities_values/__init__.py new file mode 100644 index 000000000..49d1090f2 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinities_values/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_affinities_value +class path_affinities_values(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-properties/path-affinities-values. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as values. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinities_value',) + + _yang_name = 'path-affinities-values' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-properties', 'path-affinities-values'] + + def _get_path_affinities_value(self): + """ + Getter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinities_value + + def _set_path_affinities_value(self, v, load=False): + """ + Setter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_value() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_value must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_affinities_value = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_value(self): + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_affinities_value = __builtin__.property(_get_path_affinities_value) + + + _pyangbind_elements = OrderedDict([('path_affinities_value', path_affinities_value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value/__init__.py new file mode 100644 index 000000000..e387bf9bf --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value/__init__.py @@ -0,0 +1,161 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_affinities_value(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-properties/path-affinities-values/path-affinities-value. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__value',) + + _yang_name = 'path-affinities-value' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-properties', 'path-affinities-values', 'path-affinities-value'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value/usage (identityref) + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_value(self): + """ + Getter method for value, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value/value (admin-groups) + + YANG Description: The affinity value. The default is empty. + """ + return self.__value + + def _set_value(self, v, load=False): + """ + Setter method for value, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinities_values/path_affinities_value/value (admin-groups) + If this variable is read-only (config: false) in the + source YANG file, then _set_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_value() directly. + + YANG Description: The affinity value. The default is empty. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """value must be of a type compatible with admin-groups""", + 'defined-type': "ietf-te-topology:admin-groups", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False)""", + }) + + self.__value = t + if hasattr(self, '_set'): + self._set() + + def _unset_value(self): + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False) + + usage = __builtin__.property(_get_usage) + value = __builtin__.property(_get_value) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('value', value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/__init__.py new file mode 100644 index 000000000..904de87a1 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_affinity_name +class path_affinity_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-properties/path-affinity-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as names. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinity_name',) + + _yang_name = 'path-affinity-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-properties', 'path-affinity-names'] + + def _get_path_affinity_name(self): + """ + Getter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinity_name + + def _set_path_affinity_name(self, v, load=False): + """ + Setter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_name() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_name(self): + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_affinity_name = __builtin__.property(_get_path_affinity_name) + + + _pyangbind_elements = OrderedDict([('path_affinity_name', path_affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/__init__.py new file mode 100644 index 000000000..c7b9e5faf --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/__init__.py @@ -0,0 +1,162 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import affinity_name +class path_affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-properties/path-affinity-names/path-affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__affinity_name',) + + _yang_name = 'path-affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-properties', 'path-affinity-names', 'path-affinity-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/usage (identityref) + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_affinity_name(self): + """ + Getter method for affinity_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/affinity_name (list) + + YANG Description: List of named affinities. + """ + return self.__affinity_name + + def _set_affinity_name(self, v, load=False): + """ + Setter method for affinity_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_affinity_name() directly. + + YANG Description: List of named affinities. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_affinity_name(self): + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + usage = __builtin__.property(_get_usage) + affinity_name = __builtin__.property(_get_affinity_name) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('affinity_name', affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py new file mode 100644 index 000000000..8e41672e8 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-properties/path-affinity-names/path-affinity-name/affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinities. + """ + __slots__ = ('_path_helper', '_extmethods', '__name',) + + _yang_name = 'affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-properties', 'path-affinity-names', 'path-affinity-name', 'affinity-name'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/affinity_name/name (string) + + YANG Description: Identifies a named affinity entry. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_affinity_names/path_affinity_name/affinity_name/name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: Identifies a named affinity entry. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + name = __builtin__.property(_get_name) + + + _pyangbind_elements = OrderedDict([('name', name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_metric/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_metric/__init__.py new file mode 100644 index 000000000..0a8fae1c4 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_metric/__init__.py @@ -0,0 +1,159 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_metric(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-properties/path-metric. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE path metric type. + """ + __slots__ = ('_path_helper', '_extmethods', '__metric_type','__accumulative_value',) + + _yang_name = 'path-metric' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__accumulative_value = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-properties', 'path-metric'] + + def _get_metric_type(self): + """ + Getter method for metric_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_metric/metric_type (identityref) + + YANG Description: TE path metric type. + """ + return self.__metric_type + + def _set_metric_type(self, v, load=False): + """ + Setter method for metric_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_metric/metric_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_metric_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_metric_type() directly. + + YANG Description: TE path metric type. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """metric_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__metric_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_metric_type(self): + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_accumulative_value(self): + """ + Getter method for accumulative_value, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_metric/accumulative_value (uint64) + + YANG Description: TE path metric accumulative value. + """ + return self.__accumulative_value + + def _set_accumulative_value(self, v, load=False): + """ + Setter method for accumulative_value, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_metric/accumulative_value (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_accumulative_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_accumulative_value() directly. + + YANG Description: TE path metric accumulative value. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """accumulative_value must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False)""", + }) + + self.__accumulative_value = t + if hasattr(self, '_set'): + self._set() + + def _unset_accumulative_value(self): + self.__accumulative_value = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + + metric_type = __builtin__.property(_get_metric_type) + accumulative_value = __builtin__.property(_get_accumulative_value) + + + _pyangbind_elements = OrderedDict([('metric_type', metric_type), ('accumulative_value', accumulative_value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/__init__.py new file mode 100644 index 000000000..9f30f10e6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/__init__.py @@ -0,0 +1,119 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_route_object +class path_route_objects(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-properties/path-route-objects. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of route objects either returned by +the computation engine or actually used by an LSP. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_route_object',) + + _yang_name = 'path-route-objects' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_route_object = YANGDynClass(base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-properties', 'path-route-objects'] + + def _get_path_route_object(self): + """ + Getter method for path_route_object, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object (list) + + YANG Description: List of route objects either returned by the computation +engine or actually used by an LSP. + """ + return self.__path_route_object + + def _set_path_route_object(self, v, load=False): + """ + Setter method for path_route_object, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_route_object is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_route_object() directly. + + YANG Description: List of route objects either returned by the computation +engine or actually used by an LSP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_route_object must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_route_object = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_route_object(self): + self.__path_route_object = YANGDynClass(base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_route_object = __builtin__.property(_get_path_route_object) + + + _pyangbind_elements = OrderedDict([('path_route_object', path_route_object), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/__init__.py new file mode 100644 index 000000000..9e85f737c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/__init__.py @@ -0,0 +1,327 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class path_route_object(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-properties/path-route-objects/path-route-object. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of route objects either returned by the computation +engine or actually used by an LSP. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'path-route-object' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-properties', 'path-route-objects', 'path-route-object'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/index (uint32) + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key +values. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/index (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key +values. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + index = __builtin__.property(_get_index) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop) + label_hop = __builtin__.property(_get_label_hop) + + __choices__ = {'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('index', index), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/as_number_hop/__init__.py new file mode 100644 index 000000000..14f8c67c4 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-properties/path-route-objects/path-route-object/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-properties', 'path-route-objects', 'path-route-object', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + as_number = __builtin__.property(_get_as_number) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/__init__.py new file mode 100644 index 000000000..d816d11be --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-properties/path-route-objects/path-route-object/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-properties', 'path-route-objects', 'path-route-object', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_label = __builtin__.property(_get_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/__init__.py new file mode 100644 index 000000000..2b21aa6b8 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-properties/path-route-objects/path-route-object/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-properties', 'path-route-objects', 'path-route-object', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + vlanid = __builtin__.property(_get_vlanid) + direction = __builtin__.property(_get_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/__init__.py new file mode 100644 index 000000000..f24877ab2 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-properties/path-route-objects/path-route-object/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-properties', 'path-route-objects', 'path-route-object', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + + tpn = __builtin__.property(_get_tpn) + tsg = __builtin__.property(_get_tsg) + ts_list = __builtin__.property(_get_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop/__init__.py new file mode 100644 index 000000000..266d0f1c0 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-properties/path-route-objects/path-route-object/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-properties', 'path-route-objects', 'path-route-object', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_node_hop/__init__.py new file mode 100644 index 000000000..1e2ef7ce2 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-properties/path-route-objects/path-route-object/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-properties', 'path-route-objects', 'path-route-object', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_node_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/__init__.py new file mode 100644 index 000000000..70b149a48 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-properties/path-route-objects/path-route-object/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-properties', 'path-route-objects', 'path-route-object', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_lists/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_lists/__init__.py new file mode 100644 index 000000000..b6b374b8c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_lists/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_srlgs_list +class path_srlgs_lists(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-properties/path-srlgs-lists. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path SRLG properties container. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_list',) + + _yang_name = 'path-srlgs-lists' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-properties', 'path-srlgs-lists'] + + def _get_path_srlgs_list(self): + """ + Getter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list (list) + + YANG Description: List of SRLG values to be included or excluded. + """ + return self.__path_srlgs_list + + def _set_path_srlgs_list(self, v, load=False): + """ + Setter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_list() directly. + + YANG Description: List of SRLG values to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_list must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_srlgs_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_list(self): + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_srlgs_list = __builtin__.property(_get_path_srlgs_list) + + + _pyangbind_elements = OrderedDict([('path_srlgs_list', path_srlgs_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py new file mode 100644 index 000000000..59e2a8be2 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py @@ -0,0 +1,161 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_srlgs_list(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-properties/path-srlgs-lists/path-srlgs-list. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of SRLG values to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__values',) + + _yang_name = 'path-srlgs-list' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-properties', 'path-srlgs-lists', 'path-srlgs-list'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list/usage (identityref) + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_values(self): + """ + Getter method for values, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list/values (srlg) + + YANG Description: List of SRLG values. + """ + return self.__values + + def _set_values(self, v, load=False): + """ + Setter method for values, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_lists/path_srlgs_list/values (srlg) + If this variable is read-only (config: false) in the + source YANG file, then _set_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_values() directly. + + YANG Description: List of SRLG values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """values must be of a type compatible with srlg""", + 'defined-type': "ietf-te-topology:srlg", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False)""", + }) + + self.__values = t + if hasattr(self, '_set'): + self._set() + + def _unset_values(self): + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False) + + usage = __builtin__.property(_get_usage) + values = __builtin__.property(_get_values) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('values', values), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_names/__init__.py new file mode 100644 index 000000000..106738441 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_names/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_srlgs_name +class path_srlgs_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-properties/path-srlgs-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of named SRLGs. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_name',) + + _yang_name = 'path-srlgs-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-properties', 'path-srlgs-names'] + + def _get_path_srlgs_name(self): + """ + Getter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name (list) + + YANG Description: List of named SRLGs to be included or excluded. + """ + return self.__path_srlgs_name + + def _set_path_srlgs_name(self, v, load=False): + """ + Setter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_name() directly. + + YANG Description: List of named SRLGs to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_srlgs_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_name(self): + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_srlgs_name = __builtin__.property(_get_path_srlgs_name) + + + _pyangbind_elements = OrderedDict([('path_srlgs_name', path_srlgs_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name/__init__.py new file mode 100644 index 000000000..20a2aee2a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name/__init__.py @@ -0,0 +1,161 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_srlgs_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/path-properties/path-srlgs-names/path-srlgs-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named SRLGs to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__names',) + + _yang_name = 'path-srlgs-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'path-properties', 'path-srlgs-names', 'path-srlgs-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name/usage (identityref) + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_names(self): + """ + Getter method for names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name/names (string) + + YANG Description: List of named SRLGs. + """ + return self.__names + + def _set_names(self, v, load=False): + """ + Setter method for names, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/path_properties/path_srlgs_names/path_srlgs_name/names (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_names() directly. + + YANG Description: List of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """names must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__names = t + if hasattr(self, '_set'): + self._set() + + def _unset_names(self): + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + usage = __builtin__.property(_get_usage) + names = __builtin__.property(_get_names) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('names', names), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/__init__.py new file mode 100644 index 000000000..4d1acaeb5 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/__init__.py @@ -0,0 +1,326 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import primary_path +from . import backup_path +from . import tunnel_termination_points +from . import tunnels +class underlay(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/underlay. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Attributes of the TE link underlay. + """ + __slots__ = ('_path_helper', '_extmethods', '__enabled','__primary_path','__backup_path','__protection_type','__tunnel_termination_points','__tunnels',) + + _yang_name = 'underlay' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__enabled = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + self.__primary_path = YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__backup_path = YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + self.__protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__tunnel_termination_points = YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__tunnels = YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'underlay'] + + def _get_enabled(self): + """ + Getter method for enabled, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/enabled (boolean) + + YANG Description: 'true' if the underlay is enabled. +'false' if the underlay is disabled. + """ + return self.__enabled + + def _set_enabled(self, v, load=False): + """ + Setter method for enabled, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/enabled (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_enabled is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_enabled() directly. + + YANG Description: 'true' if the underlay is enabled. +'false' if the underlay is disabled. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """enabled must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__enabled = t + if hasattr(self, '_set'): + self._set() + + def _unset_enabled(self): + self.__enabled = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + + def _get_primary_path(self): + """ + Getter method for primary_path, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path (container) + + YANG Description: The service path on the underlay topology that +supports this link. + """ + return self.__primary_path + + def _set_primary_path(self, v, load=False): + """ + Setter method for primary_path, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_primary_path is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_primary_path() directly. + + YANG Description: The service path on the underlay topology that +supports this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """primary_path must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__primary_path = t + if hasattr(self, '_set'): + self._set() + + def _unset_primary_path(self): + self.__primary_path = YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_backup_path(self): + """ + Getter method for backup_path, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path (list) + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + return self.__backup_path + + def _set_backup_path(self, v, load=False): + """ + Setter method for backup_path, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_backup_path is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_backup_path() directly. + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """backup_path must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__backup_path = t + if hasattr(self, '_set'): + self._set() + + def _unset_backup_path(self): + self.__backup_path = YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + + def _get_protection_type(self): + """ + Getter method for protection_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/protection_type (identityref) + + YANG Description: Underlay protection type desired for this link. + """ + return self.__protection_type + + def _set_protection_type(self, v, load=False): + """ + Setter method for protection_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/protection_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_protection_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_protection_type() directly. + + YANG Description: Underlay protection type desired for this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """protection_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__protection_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_protection_type(self): + self.__protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_tunnel_termination_points(self): + """ + Getter method for tunnel_termination_points, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnel_termination_points (container) + + YANG Description: Underlay TTPs desired for this link. + """ + return self.__tunnel_termination_points + + def _set_tunnel_termination_points(self, v, load=False): + """ + Setter method for tunnel_termination_points, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnel_termination_points (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel_termination_points is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel_termination_points() directly. + + YANG Description: Underlay TTPs desired for this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel_termination_points must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__tunnel_termination_points = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel_termination_points(self): + self.__tunnel_termination_points = YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_tunnels(self): + """ + Getter method for tunnels, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnels (container) + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + return self.__tunnels + + def _set_tunnels(self, v, load=False): + """ + Setter method for tunnels, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnels (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnels is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnels() directly. + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnels must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__tunnels = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnels(self): + self.__tunnels = YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + enabled = __builtin__.property(_get_enabled, _set_enabled) + primary_path = __builtin__.property(_get_primary_path, _set_primary_path) + backup_path = __builtin__.property(_get_backup_path, _set_backup_path) + protection_type = __builtin__.property(_get_protection_type, _set_protection_type) + tunnel_termination_points = __builtin__.property(_get_tunnel_termination_points, _set_tunnel_termination_points) + tunnels = __builtin__.property(_get_tunnels, _set_tunnels) + + + _pyangbind_elements = OrderedDict([('enabled', enabled), ('primary_path', primary_path), ('backup_path', backup_path), ('protection_type', protection_type), ('tunnel_termination_points', tunnel_termination_points), ('tunnels', tunnels), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/__init__.py new file mode 100644 index 000000000..d6dae0208 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/__init__.py @@ -0,0 +1,207 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_element +class backup_path(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/underlay/backup-path. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__network_ref','__path_element',) + + _yang_name = 'backup-path' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'underlay', 'backup-path'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/index (uint32) + + YANG Description: A sequence number to identify a backup path. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/index (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: A sequence number to identify a backup path. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + + def _get_path_element(self): + """ + Getter method for path_element, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element (list) + + YANG Description: A list of path elements describing the backup service +path. + """ + return self.__path_element + + def _set_path_element(self, v, load=False): + """ + Setter method for path_element, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element() directly. + + YANG Description: A list of path elements describing the backup service +path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_element = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element(self): + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + index = __builtin__.property(_get_index, _set_index) + network_ref = __builtin__.property(_get_network_ref, _set_network_ref) + path_element = __builtin__.property(_get_path_element, _set_path_element) + + + _pyangbind_elements = OrderedDict([('index', index), ('network_ref', network_ref), ('path_element', path_element), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/__init__.py new file mode 100644 index 000000000..32f0ddafb --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/__init__.py @@ -0,0 +1,321 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class path_element(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/underlay/backup-path/path-element. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of path elements describing the backup service +path. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_element_id','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'path-element' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'underlay', 'backup-path', 'path-element'] + + def _get_path_element_id(self): + """ + Getter method for path_element_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/path_element_id (uint32) + + YANG Description: To identify the element in a path. + """ + return self.__path_element_id + + def _set_path_element_id(self, v, load=False): + """ + Setter method for path_element_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/path_element_id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element_id() directly. + + YANG Description: To identify the element in a path. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element_id must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__path_element_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element_id(self): + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + path_element_id = __builtin__.property(_get_path_element_id, _set_path_element_id) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop, _set_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop, _set_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop, _set_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop, _set_as_number_hop) + label_hop = __builtin__.property(_get_label_hop, _set_label_hop) + + __choices__ = {'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('path_element_id', path_element_id), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/as_number_hop/__init__.py new file mode 100644 index 000000000..3522a13e9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/underlay/backup-path/path-element/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'underlay', 'backup-path', 'path-element', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + as_number = __builtin__.property(_get_as_number, _set_as_number) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/__init__.py new file mode 100644 index 000000000..ce150a605 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/underlay/backup-path/path-element/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'underlay', 'backup-path', 'path-element', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/__init__.py new file mode 100644 index 000000000..ef37b6389 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/underlay/backup-path/path-element/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'underlay', 'backup-path', 'path-element', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py new file mode 100644 index 000000000..64da0e1fd --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/underlay/backup-path/path-element/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'underlay', 'backup-path', 'path-element', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + tsg = __builtin__.property(_get_tsg, _set_tsg) + ts_list = __builtin__.property(_get_ts_list, _set_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop/__init__.py new file mode 100644 index 000000000..7b441de5c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/underlay/backup-path/path-element/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'underlay', 'backup-path', 'path-element', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/numbered_node_hop/__init__.py new file mode 100644 index 000000000..9a2ff93d5 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/underlay/backup-path/path-element/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'underlay', 'backup-path', 'path-element', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/numbered_node_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py new file mode 100644 index 000000000..8f686b596 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/underlay/backup-path/path-element/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'underlay', 'backup-path', 'path-element', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/backup_path/path_element/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/__init__.py new file mode 100644 index 000000000..c75b0b216 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/__init__.py @@ -0,0 +1,158 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_element +class primary_path(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/underlay/primary-path. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The service path on the underlay topology that +supports this link. + """ + __slots__ = ('_path_helper', '_extmethods', '__network_ref','__path_element',) + + _yang_name = 'primary-path' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'underlay', 'primary-path'] + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + + def _get_path_element(self): + """ + Getter method for path_element, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element (list) + + YANG Description: A list of path elements describing the service path. + """ + return self.__path_element + + def _set_path_element(self, v, load=False): + """ + Setter method for path_element, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element() directly. + + YANG Description: A list of path elements describing the service path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_element = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element(self): + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + network_ref = __builtin__.property(_get_network_ref, _set_network_ref) + path_element = __builtin__.property(_get_path_element, _set_path_element) + + + _pyangbind_elements = OrderedDict([('network_ref', network_ref), ('path_element', path_element), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/__init__.py new file mode 100644 index 000000000..e9c1a6170 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/__init__.py @@ -0,0 +1,320 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class path_element(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/underlay/primary-path/path-element. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of path elements describing the service path. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_element_id','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'path-element' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'underlay', 'primary-path', 'path-element'] + + def _get_path_element_id(self): + """ + Getter method for path_element_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/path_element_id (uint32) + + YANG Description: To identify the element in a path. + """ + return self.__path_element_id + + def _set_path_element_id(self, v, load=False): + """ + Setter method for path_element_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/path_element_id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element_id() directly. + + YANG Description: To identify the element in a path. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element_id must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__path_element_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element_id(self): + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + path_element_id = __builtin__.property(_get_path_element_id, _set_path_element_id) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop, _set_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop, _set_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop, _set_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop, _set_as_number_hop) + label_hop = __builtin__.property(_get_label_hop, _set_label_hop) + + __choices__ = {'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('path_element_id', path_element_id), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/as_number_hop/__init__.py new file mode 100644 index 000000000..2c3bb0005 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/underlay/primary-path/path-element/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'underlay', 'primary-path', 'path-element', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + as_number = __builtin__.property(_get_as_number, _set_as_number) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/__init__.py new file mode 100644 index 000000000..fc6a16219 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/underlay/primary-path/path-element/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'underlay', 'primary-path', 'path-element', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/__init__.py new file mode 100644 index 000000000..d1db2ca23 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/underlay/primary-path/path-element/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'underlay', 'primary-path', 'path-element', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py new file mode 100644 index 000000000..0b291e326 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/underlay/primary-path/path-element/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'underlay', 'primary-path', 'path-element', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + tsg = __builtin__.property(_get_tsg, _set_tsg) + ts_list = __builtin__.property(_get_ts_list, _set_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop/__init__.py new file mode 100644 index 000000000..ccb0ca471 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/underlay/primary-path/path-element/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'underlay', 'primary-path', 'path-element', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/numbered_node_hop/__init__.py new file mode 100644 index 000000000..5c0fdf8da --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/underlay/primary-path/path-element/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'underlay', 'primary-path', 'path-element', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/numbered_node_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py new file mode 100644 index 000000000..c70dd4cc0 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/underlay/primary-path/path-element/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'underlay', 'primary-path', 'path-element', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/primary_path/path_element/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnel_termination_points/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnel_termination_points/__init__.py new file mode 100644 index 000000000..01b0c3976 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnel_termination_points/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class tunnel_termination_points(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/underlay/tunnel-termination-points. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Underlay TTPs desired for this link. + """ + __slots__ = ('_path_helper', '_extmethods', '__source','__destination',) + + _yang_name = 'tunnel-termination-points' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__source = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + self.__destination = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'underlay', 'tunnel-termination-points'] + + def _get_source(self): + """ + Getter method for source, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnel_termination_points/source (binary) + + YANG Description: Source TTP identifier. + """ + return self.__source + + def _set_source(self, v, load=False): + """ + Setter method for source, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnel_termination_points/source (binary) + If this variable is read-only (config: false) in the + source YANG file, then _set_source is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_source() directly. + + YANG Description: Source TTP identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """source must be of a type compatible with binary""", + 'defined-type': "binary", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True)""", + }) + + self.__source = t + if hasattr(self, '_set'): + self._set() + + def _unset_source(self): + self.__source = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + + + def _get_destination(self): + """ + Getter method for destination, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnel_termination_points/destination (binary) + + YANG Description: Destination TTP identifier. + """ + return self.__destination + + def _set_destination(self, v, load=False): + """ + Setter method for destination, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnel_termination_points/destination (binary) + If this variable is read-only (config: false) in the + source YANG file, then _set_destination is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_destination() directly. + + YANG Description: Destination TTP identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """destination must be of a type compatible with binary""", + 'defined-type': "binary", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True)""", + }) + + self.__destination = t + if hasattr(self, '_set'): + self._set() + + def _unset_destination(self): + self.__destination = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + + source = __builtin__.property(_get_source, _set_source) + destination = __builtin__.property(_get_destination, _set_destination) + + + _pyangbind_elements = OrderedDict([('source', source), ('destination', destination), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnels/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnels/__init__.py new file mode 100644 index 000000000..c8b792d49 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnels/__init__.py @@ -0,0 +1,167 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import tunnel +class tunnels(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/underlay/tunnels. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + __slots__ = ('_path_helper', '_extmethods', '__sharing','__tunnel',) + + _yang_name = 'tunnels' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__sharing = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + self.__tunnel = YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'underlay', 'tunnels'] + + def _get_sharing(self): + """ + Getter method for sharing, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnels/sharing (boolean) + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. +This leaf is the default option for all TE tunnels +and may be overridden by the per-TE-tunnel value. + """ + return self.__sharing + + def _set_sharing(self, v, load=False): + """ + Setter method for sharing, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnels/sharing (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_sharing is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_sharing() directly. + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. +This leaf is the default option for all TE tunnels +and may be overridden by the per-TE-tunnel value. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """sharing must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__sharing = t + if hasattr(self, '_set'): + self._set() + + def _unset_sharing(self): + self.__sharing = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + + def _get_tunnel(self): + """ + Getter method for tunnel, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnels/tunnel (list) + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + return self.__tunnel + + def _set_tunnel(self, v, load=False): + """ + Setter method for tunnel, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnels/tunnel (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel() directly. + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__tunnel = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel(self): + self.__tunnel = YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + sharing = __builtin__.property(_get_sharing, _set_sharing) + tunnel = __builtin__.property(_get_tunnel, _set_tunnel) + + + _pyangbind_elements = OrderedDict([('sharing', sharing), ('tunnel', tunnel), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnels/tunnel/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnels/tunnel/__init__.py new file mode 100644 index 000000000..03756dbc3 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnels/tunnel/__init__.py @@ -0,0 +1,170 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class tunnel(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/connectivity-matrices/underlay/tunnels/tunnel. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + __slots__ = ('_path_helper', '_extmethods', '__tunnel_name','__sharing',) + + _yang_name = 'tunnel' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tunnel_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + self.__sharing = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'connectivity-matrices', 'underlay', 'tunnels', 'tunnel'] + + def _get_tunnel_name(self): + """ + Getter method for tunnel_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnels/tunnel/tunnel_name (string) + + YANG Description: A tunnel name uniquely identifies an underlay TE tunnel, +used together with the 'source-node' value for this +link. + """ + return self.__tunnel_name + + def _set_tunnel_name(self, v, load=False): + """ + Setter method for tunnel_name, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnels/tunnel/tunnel_name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel_name() directly. + + YANG Description: A tunnel name uniquely identifies an underlay TE tunnel, +used together with the 'source-node' value for this +link. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel_name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True)""", + }) + + self.__tunnel_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel_name(self): + self.__tunnel_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + + def _get_sharing(self): + """ + Getter method for sharing, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnels/tunnel/sharing (boolean) + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. + """ + return self.__sharing + + def _set_sharing(self, v, load=False): + """ + Setter method for sharing, mapped from YANG variable /networks/network/node/te/te_node_attributes/connectivity_matrices/underlay/tunnels/tunnel/sharing (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_sharing is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_sharing() directly. + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """sharing must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__sharing = t + if hasattr(self, '_set'): + self._set() + + def _unset_sharing(self): + self.__sharing = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + tunnel_name = __builtin__.property(_get_tunnel_name, _set_tunnel_name) + sharing = __builtin__.property(_get_sharing, _set_sharing) + + + _pyangbind_elements = OrderedDict([('tunnel_name', tunnel_name), ('sharing', sharing), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/underlay_topology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/underlay_topology/__init__.py new file mode 100644 index 000000000..2e4a62679 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/te_node_attributes/underlay_topology/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class underlay_topology(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/te-node-attributes/underlay-topology. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: When an abstract node encapsulates a topology, the +attributes in this container point to said topology. + """ + __slots__ = ('_path_helper', '_extmethods', '__network_ref',) + + _yang_name = 'underlay-topology' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'te-node-attributes', 'underlay-topology'] + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/node/te/te_node_attributes/underlay_topology/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/node/te/te_node_attributes/underlay_topology/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + network_ref = __builtin__.property(_get_network_ref, _set_network_ref) + + + _pyangbind_elements = OrderedDict([('network_ref', network_ref), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/__init__.py new file mode 100644 index 000000000..92fbb57f7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/__init__.py @@ -0,0 +1,597 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import client_layer_adaptation +from . import local_link_connectivities +from . import geolocation +from . import statistics +from . import supporting_tunnel_termination_point +class tunnel_termination_point(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A termination point can terminate a tunnel. + """ + __slots__ = ('_path_helper', '_extmethods', '__tunnel_tp_id','__admin_status','__name','__switching_capability','__encoding','__inter_layer_lock_id','__protection_type','__client_layer_adaptation','__local_link_connectivities','__oper_status','__geolocation','__statistics','__supporting_tunnel_termination_point',) + + _yang_name = 'tunnel-termination-point' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tunnel_tp_id = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="tunnel-tp-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + self.__admin_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True) + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + self.__switching_capability = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__encoding = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__inter_layer_lock_id = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="inter-layer-lock-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__client_layer_adaptation = YANGDynClass(base=client_layer_adaptation.client_layer_adaptation, is_container='container', yang_name="client-layer-adaptation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__local_link_connectivities = YANGDynClass(base=local_link_connectivities.local_link_connectivities, is_container='container', yang_name="local-link-connectivities", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__oper_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-oper-status', is_config=False) + self.__geolocation = YANGDynClass(base=geolocation.geolocation, is_container='container', yang_name="geolocation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__statistics = YANGDynClass(base=statistics.statistics, is_container='container', yang_name="statistics", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__supporting_tunnel_termination_point = YANGDynClass(base=YANGListType("node_ref tunnel_tp_ref",supporting_tunnel_termination_point.supporting_tunnel_termination_point, yang_name="supporting-tunnel-termination-point", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='node-ref tunnel-tp-ref', extensions=None), is_container='list', yang_name="supporting-tunnel-termination-point", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point'] + + def _get_tunnel_tp_id(self): + """ + Getter method for tunnel_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/tunnel_tp_id (binary) + + YANG Description: TTP identifier. + """ + return self.__tunnel_tp_id + + def _set_tunnel_tp_id(self, v, load=False): + """ + Setter method for tunnel_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/tunnel_tp_id (binary) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel_tp_id() directly. + + YANG Description: TTP identifier. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="tunnel-tp-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel_tp_id must be of a type compatible with binary""", + 'defined-type': "binary", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="tunnel-tp-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True)""", + }) + + self.__tunnel_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel_tp_id(self): + self.__tunnel_tp_id = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="tunnel-tp-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + + + def _get_admin_status(self): + """ + Getter method for admin_status, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/admin_status (te-types:te-admin-status) + + YANG Description: The administrative state of the TTP. + """ + return self.__admin_status + + def _set_admin_status(self, v, load=False): + """ + Setter method for admin_status, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/admin_status (te-types:te-admin-status) + If this variable is read-only (config: false) in the + source YANG file, then _set_admin_status is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_admin_status() directly. + + YANG Description: The administrative state of the TTP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """admin_status must be of a type compatible with te-types:te-admin-status""", + 'defined-type': "te-types:te-admin-status", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True)""", + }) + + self.__admin_status = t + if hasattr(self, '_set'): + self._set() + + def _unset_admin_status(self): + self.__admin_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True) + + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/name (string) + + YANG Description: A descriptive name for the TTP. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: A descriptive name for the TTP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + + def _get_switching_capability(self): + """ + Getter method for switching_capability, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/switching_capability (identityref) + + YANG Description: Switching capability for this interface. + """ + return self.__switching_capability + + def _set_switching_capability(self, v, load=False): + """ + Setter method for switching_capability, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/switching_capability (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_switching_capability is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_switching_capability() directly. + + YANG Description: Switching capability for this interface. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """switching_capability must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__switching_capability = t + if hasattr(self, '_set'): + self._set() + + def _unset_switching_capability(self): + self.__switching_capability = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_encoding(self): + """ + Getter method for encoding, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/encoding (identityref) + + YANG Description: Encoding supported by this interface. + """ + return self.__encoding + + def _set_encoding(self, v, load=False): + """ + Setter method for encoding, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/encoding (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_encoding is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_encoding() directly. + + YANG Description: Encoding supported by this interface. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """encoding must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__encoding = t + if hasattr(self, '_set'): + self._set() + + def _unset_encoding(self): + self.__encoding = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_inter_layer_lock_id(self): + """ + Getter method for inter_layer_lock_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/inter_layer_lock_id (uint32) + + YANG Description: Inter-layer lock ID, used for path computation in a TE +topology covering multiple layers or multiple regions. + """ + return self.__inter_layer_lock_id + + def _set_inter_layer_lock_id(self, v, load=False): + """ + Setter method for inter_layer_lock_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/inter_layer_lock_id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_inter_layer_lock_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_inter_layer_lock_id() directly. + + YANG Description: Inter-layer lock ID, used for path computation in a TE +topology covering multiple layers or multiple regions. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="inter-layer-lock-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """inter_layer_lock_id must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="inter-layer-lock-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__inter_layer_lock_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_inter_layer_lock_id(self): + self.__inter_layer_lock_id = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="inter-layer-lock-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_protection_type(self): + """ + Getter method for protection_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/protection_type (identityref) + + YANG Description: The protection type that this TTP is capable of. + """ + return self.__protection_type + + def _set_protection_type(self, v, load=False): + """ + Setter method for protection_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/protection_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_protection_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_protection_type() directly. + + YANG Description: The protection type that this TTP is capable of. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """protection_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__protection_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_protection_type(self): + self.__protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_client_layer_adaptation(self): + """ + Getter method for client_layer_adaptation, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation (container) + + YANG Description: Contains capability information to support a client-layer +adaptation in a multi-layer topology. + """ + return self.__client_layer_adaptation + + def _set_client_layer_adaptation(self, v, load=False): + """ + Setter method for client_layer_adaptation, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_client_layer_adaptation is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_client_layer_adaptation() directly. + + YANG Description: Contains capability information to support a client-layer +adaptation in a multi-layer topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=client_layer_adaptation.client_layer_adaptation, is_container='container', yang_name="client-layer-adaptation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """client_layer_adaptation must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=client_layer_adaptation.client_layer_adaptation, is_container='container', yang_name="client-layer-adaptation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__client_layer_adaptation = t + if hasattr(self, '_set'): + self._set() + + def _unset_client_layer_adaptation(self): + self.__client_layer_adaptation = YANGDynClass(base=client_layer_adaptation.client_layer_adaptation, is_container='container', yang_name="client-layer-adaptation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_local_link_connectivities(self): + """ + Getter method for local_link_connectivities, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities (container) + + YANG Description: Contains an LLCL for a TTP on a TE node. + """ + return self.__local_link_connectivities + + def _set_local_link_connectivities(self, v, load=False): + """ + Setter method for local_link_connectivities, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_local_link_connectivities is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_local_link_connectivities() directly. + + YANG Description: Contains an LLCL for a TTP on a TE node. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=local_link_connectivities.local_link_connectivities, is_container='container', yang_name="local-link-connectivities", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """local_link_connectivities must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=local_link_connectivities.local_link_connectivities, is_container='container', yang_name="local-link-connectivities", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__local_link_connectivities = t + if hasattr(self, '_set'): + self._set() + + def _unset_local_link_connectivities(self): + self.__local_link_connectivities = YANGDynClass(base=local_link_connectivities.local_link_connectivities, is_container='container', yang_name="local-link-connectivities", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_oper_status(self): + """ + Getter method for oper_status, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/oper_status (te-types:te-oper-status) + + YANG Description: The current operational state of the TTP. + """ + return self.__oper_status + + def _set_oper_status(self, v, load=False): + """ + Setter method for oper_status, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/oper_status (te-types:te-oper-status) + If this variable is read-only (config: false) in the + source YANG file, then _set_oper_status is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_oper_status() directly. + + YANG Description: The current operational state of the TTP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-oper-status', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """oper_status must be of a type compatible with te-types:te-oper-status""", + 'defined-type': "te-types:te-oper-status", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-oper-status', is_config=False)""", + }) + + self.__oper_status = t + if hasattr(self, '_set'): + self._set() + + def _unset_oper_status(self): + self.__oper_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-oper-status', is_config=False) + + + def _get_geolocation(self): + """ + Getter method for geolocation, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/geolocation (container) + + YANG Description: Contains a GPS location. + """ + return self.__geolocation + + def _set_geolocation(self, v, load=False): + """ + Setter method for geolocation, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/geolocation (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_geolocation is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_geolocation() directly. + + YANG Description: Contains a GPS location. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=geolocation.geolocation, is_container='container', yang_name="geolocation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """geolocation must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=geolocation.geolocation, is_container='container', yang_name="geolocation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__geolocation = t + if hasattr(self, '_set'): + self._set() + + def _unset_geolocation(self): + self.__geolocation = YANGDynClass(base=geolocation.geolocation, is_container='container', yang_name="geolocation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_statistics(self): + """ + Getter method for statistics, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics (container) + + YANG Description: Statistics data. + """ + return self.__statistics + + def _set_statistics(self, v, load=False): + """ + Setter method for statistics, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_statistics is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_statistics() directly. + + YANG Description: Statistics data. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=statistics.statistics, is_container='container', yang_name="statistics", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """statistics must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=statistics.statistics, is_container='container', yang_name="statistics", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__statistics = t + if hasattr(self, '_set'): + self._set() + + def _unset_statistics(self): + self.__statistics = YANGDynClass(base=statistics.statistics, is_container='container', yang_name="statistics", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_supporting_tunnel_termination_point(self): + """ + Getter method for supporting_tunnel_termination_point, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/supporting_tunnel_termination_point (list) + + YANG Description: Identifies the TTPs on which this TTP depends. + """ + return self.__supporting_tunnel_termination_point + + def _set_supporting_tunnel_termination_point(self, v, load=False): + """ + Setter method for supporting_tunnel_termination_point, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/supporting_tunnel_termination_point (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_supporting_tunnel_termination_point is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_supporting_tunnel_termination_point() directly. + + YANG Description: Identifies the TTPs on which this TTP depends. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("node_ref tunnel_tp_ref",supporting_tunnel_termination_point.supporting_tunnel_termination_point, yang_name="supporting-tunnel-termination-point", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='node-ref tunnel-tp-ref', extensions=None), is_container='list', yang_name="supporting-tunnel-termination-point", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """supporting_tunnel_termination_point must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("node_ref tunnel_tp_ref",supporting_tunnel_termination_point.supporting_tunnel_termination_point, yang_name="supporting-tunnel-termination-point", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='node-ref tunnel-tp-ref', extensions=None), is_container='list', yang_name="supporting-tunnel-termination-point", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__supporting_tunnel_termination_point = t + if hasattr(self, '_set'): + self._set() + + def _unset_supporting_tunnel_termination_point(self): + self.__supporting_tunnel_termination_point = YANGDynClass(base=YANGListType("node_ref tunnel_tp_ref",supporting_tunnel_termination_point.supporting_tunnel_termination_point, yang_name="supporting-tunnel-termination-point", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='node-ref tunnel-tp-ref', extensions=None), is_container='list', yang_name="supporting-tunnel-termination-point", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + tunnel_tp_id = __builtin__.property(_get_tunnel_tp_id, _set_tunnel_tp_id) + admin_status = __builtin__.property(_get_admin_status, _set_admin_status) + name = __builtin__.property(_get_name, _set_name) + switching_capability = __builtin__.property(_get_switching_capability, _set_switching_capability) + encoding = __builtin__.property(_get_encoding, _set_encoding) + inter_layer_lock_id = __builtin__.property(_get_inter_layer_lock_id, _set_inter_layer_lock_id) + protection_type = __builtin__.property(_get_protection_type, _set_protection_type) + client_layer_adaptation = __builtin__.property(_get_client_layer_adaptation, _set_client_layer_adaptation) + local_link_connectivities = __builtin__.property(_get_local_link_connectivities, _set_local_link_connectivities) + oper_status = __builtin__.property(_get_oper_status) + geolocation = __builtin__.property(_get_geolocation) + statistics = __builtin__.property(_get_statistics) + supporting_tunnel_termination_point = __builtin__.property(_get_supporting_tunnel_termination_point, _set_supporting_tunnel_termination_point) + + + _pyangbind_elements = OrderedDict([('tunnel_tp_id', tunnel_tp_id), ('admin_status', admin_status), ('name', name), ('switching_capability', switching_capability), ('encoding', encoding), ('inter_layer_lock_id', inter_layer_lock_id), ('protection_type', protection_type), ('client_layer_adaptation', client_layer_adaptation), ('local_link_connectivities', local_link_connectivities), ('oper_status', oper_status), ('geolocation', geolocation), ('statistics', statistics), ('supporting_tunnel_termination_point', supporting_tunnel_termination_point), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/__init__.py new file mode 100644 index 000000000..35927a2b6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/__init__.py @@ -0,0 +1,117 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import switching_capability +class client_layer_adaptation(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/client-layer-adaptation. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains capability information to support a client-layer +adaptation in a multi-layer topology. + """ + __slots__ = ('_path_helper', '_extmethods', '__switching_capability',) + + _yang_name = 'client-layer-adaptation' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__switching_capability = YANGDynClass(base=YANGListType("switching_capability encoding",switching_capability.switching_capability, yang_name="switching-capability", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='switching-capability encoding', extensions=None), is_container='list', yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'client-layer-adaptation'] + + def _get_switching_capability(self): + """ + Getter method for switching_capability, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability (list) + + YANG Description: List of supported switching capabilities. + """ + return self.__switching_capability + + def _set_switching_capability(self, v, load=False): + """ + Setter method for switching_capability, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_switching_capability is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_switching_capability() directly. + + YANG Description: List of supported switching capabilities. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("switching_capability encoding",switching_capability.switching_capability, yang_name="switching-capability", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='switching-capability encoding', extensions=None), is_container='list', yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """switching_capability must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("switching_capability encoding",switching_capability.switching_capability, yang_name="switching-capability", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='switching-capability encoding', extensions=None), is_container='list', yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__switching_capability = t + if hasattr(self, '_set'): + self._set() + + def _unset_switching_capability(self): + self.__switching_capability = YANGDynClass(base=YANGListType("switching_capability encoding",switching_capability.switching_capability, yang_name="switching-capability", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='switching-capability encoding', extensions=None), is_container='list', yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + switching_capability = __builtin__.property(_get_switching_capability, _set_switching_capability) + + + _pyangbind_elements = OrderedDict([('switching_capability', switching_capability), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/__init__.py new file mode 100644 index 000000000..4f565ac10 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/__init__.py @@ -0,0 +1,206 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_bandwidth +class switching_capability(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/client-layer-adaptation/switching-capability. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of supported switching capabilities. + """ + __slots__ = ('_path_helper', '_extmethods', '__switching_capability','__encoding','__te_bandwidth',) + + _yang_name = 'switching-capability' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__switching_capability = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__encoding = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'client-layer-adaptation', 'switching-capability'] + + def _get_switching_capability(self): + """ + Getter method for switching_capability, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/switching_capability (identityref) + + YANG Description: Switching capability for the client-layer adaptation. + """ + return self.__switching_capability + + def _set_switching_capability(self, v, load=False): + """ + Setter method for switching_capability, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/switching_capability (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_switching_capability is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_switching_capability() directly. + + YANG Description: Switching capability for the client-layer adaptation. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """switching_capability must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__switching_capability = t + if hasattr(self, '_set'): + self._set() + + def _unset_switching_capability(self): + self.__switching_capability = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_encoding(self): + """ + Getter method for encoding, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/encoding (identityref) + + YANG Description: Encoding supported by the client-layer adaptation. + """ + return self.__encoding + + def _set_encoding(self, v, load=False): + """ + Setter method for encoding, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/encoding (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_encoding is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_encoding() directly. + + YANG Description: Encoding supported by the client-layer adaptation. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """encoding must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__encoding = t + if hasattr(self, '_set'): + self._set() + + def _unset_encoding(self): + self.__encoding = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_te_bandwidth(self): + """ + Getter method for te_bandwidth, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth (container) + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + return self.__te_bandwidth + + def _set_te_bandwidth(self, v, load=False): + """ + Setter method for te_bandwidth, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_bandwidth() directly. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_bandwidth(self): + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + switching_capability = __builtin__.property(_get_switching_capability, _set_switching_capability) + encoding = __builtin__.property(_get_encoding, _set_encoding) + te_bandwidth = __builtin__.property(_get_te_bandwidth, _set_te_bandwidth) + + + _pyangbind_elements = OrderedDict([('switching_capability', switching_capability), ('encoding', encoding), ('te_bandwidth', te_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/__init__.py new file mode 100644 index 000000000..52516d759 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/__init__.py @@ -0,0 +1,195 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/client-layer-adaptation/switching-capability/te-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_bandwidth',) + + _yang_name = 'te-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'client-layer-adaptation', 'switching-capability', 'te-bandwidth'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/generic (te-bandwidth) + + YANG Description: Bandwidth specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/generic (te-bandwidth) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Bandwidth specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with te-bandwidth""", + 'defined-type': "ietf-te-topology:te-bandwidth", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/otn (container) + + YANG Description: Bandwidth attributes for OTN links + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Bandwidth attributes for OTN links + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_eth_bandwidth(self): + """ + Getter method for eth_bandwidth, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/eth_bandwidth (uint64) + + YANG Description: Available bandwith value expressed in kilobits per second + """ + return self.__eth_bandwidth + + def _set_eth_bandwidth(self, v, load=False): + """ + Setter method for eth_bandwidth, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/eth_bandwidth (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_bandwidth() directly. + + YANG Description: Available bandwith value expressed in kilobits per second + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_bandwidth must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__eth_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_bandwidth(self): + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + eth_bandwidth = __builtin__.property(_get_eth_bandwidth, _set_eth_bandwidth) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['eth_bandwidth']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_bandwidth', eth_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/otn/__init__.py new file mode 100644 index 000000000..3f44ede78 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/otn/__init__.py @@ -0,0 +1,163 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import odulist +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/client-layer-adaptation/switching-capability/te-bandwidth/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Bandwidth attributes for OTN links + """ + __slots__ = ('_path_helper', '_extmethods', '__odulist','__odtu_flex_type',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + self.__odtu_flex_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'client-layer-adaptation', 'switching-capability', 'te-bandwidth', 'otn'] + + def _get_odulist(self): + """ + Getter method for odulist, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/otn/odulist (list) + + YANG Description: OTN bandwidth definition + """ + return self.__odulist + + def _set_odulist(self, v, load=False): + """ + Setter method for odulist, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/otn/odulist (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_odulist is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odulist() directly. + + YANG Description: OTN bandwidth definition + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odulist must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True)""", + }) + + self.__odulist = t + if hasattr(self, '_set'): + self._set() + + def _unset_odulist(self): + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + + + def _get_odtu_flex_type(self): + """ + Getter method for odtu_flex_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/otn/odtu_flex_type (l1-types:odtu-flex-type) + + YANG Description: The type of Optical Data Tributary Unit (ODTU) +whose nominal bitrate is used to compute the number of +Tributary Slots (TS) required by the ODUflex LSPs +terminated on this OTN Tunnel Termination Point +(TTP). + """ + return self.__odtu_flex_type + + def _set_odtu_flex_type(self, v, load=False): + """ + Setter method for odtu_flex_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/otn/odtu_flex_type (l1-types:odtu-flex-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_odtu_flex_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odtu_flex_type() directly. + + YANG Description: The type of Optical Data Tributary Unit (ODTU) +whose nominal bitrate is used to compute the number of +Tributary Slots (TS) required by the ODUflex LSPs +terminated on this OTN Tunnel Termination Point +(TTP). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odtu_flex_type must be of a type compatible with l1-types:odtu-flex-type""", + 'defined-type': "l1-types:odtu-flex-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True)""", + }) + + self.__odtu_flex_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odtu_flex_type(self): + self.__odtu_flex_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True) + + odulist = __builtin__.property(_get_odulist, _set_odulist) + odtu_flex_type = __builtin__.property(_get_odtu_flex_type, _set_odtu_flex_type) + + __choices__ = {'technology': {'otn': ['odulist', 'odtu_flex_type']}} + _pyangbind_elements = OrderedDict([('odulist', odulist), ('odtu_flex_type', odtu_flex_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/otn/odulist/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/otn/odulist/__init__.py new file mode 100644 index 000000000..d4cb37ddf --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/otn/odulist/__init__.py @@ -0,0 +1,200 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class odulist(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/client-layer-adaptation/switching-capability/te-bandwidth/otn/odulist. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: OTN bandwidth definition + """ + __slots__ = ('_path_helper', '_extmethods', '__odu_type','__number','__ts_number',) + + _yang_name = 'odulist' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'client-layer-adaptation', 'switching-capability', 'te-bandwidth', 'otn', 'odulist'] + + def _get_odu_type(self): + """ + Getter method for odu_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/otn/odulist/odu_type (identityref) + + YANG Description: ODU type + """ + return self.__odu_type + + def _set_odu_type(self, v, load=False): + """ + Setter method for odu_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/otn/odulist/odu_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type() directly. + + YANG Description: ODU type + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__odu_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type(self): + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_number(self): + """ + Getter method for number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/otn/odulist/number (uint16) + + YANG Description: Number of ODUs + """ + return self.__number + + def _set_number(self, v, load=False): + """ + Setter method for number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/otn/odulist/number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_number() directly. + + YANG Description: Number of ODUs + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__number = t + if hasattr(self, '_set'): + self._set() + + def _unset_number(self): + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + + def _get_ts_number(self): + """ + Getter method for ts_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/otn/odulist/ts_number (uint16) + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + return self.__ts_number + + def _set_ts_number(self, v, load=False): + """ + Setter method for ts_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/client_layer_adaptation/switching_capability/te_bandwidth/otn/odulist/ts_number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_number() directly. + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__ts_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_number(self): + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + odu_type = __builtin__.property(_get_odu_type, _set_odu_type) + number = __builtin__.property(_get_number, _set_number) + ts_number = __builtin__.property(_get_ts_number, _set_ts_number) + + __choices__ = {'technology': {'otn': ['odu_type', 'number', 'ts_number']}} + _pyangbind_elements = OrderedDict([('odu_type', odu_type), ('number', number), ('ts_number', ts_number), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/geolocation/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/geolocation/__init__.py new file mode 100644 index 000000000..60eedb630 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/geolocation/__init__.py @@ -0,0 +1,193 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class geolocation(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/geolocation. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains a GPS location. + """ + __slots__ = ('_path_helper', '_extmethods', '__altitude','__latitude','__longitude',) + + _yang_name = 'geolocation' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__altitude = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64), is_leaf=True, yang_name="altitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int64', is_config=False) + self.__latitude = YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-90..90']}), is_leaf=True, yang_name="latitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False) + self.__longitude = YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-180..180']}), is_leaf=True, yang_name="longitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'geolocation'] + + def _get_altitude(self): + """ + Getter method for altitude, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/geolocation/altitude (int64) + + YANG Description: Distance above sea level. + """ + return self.__altitude + + def _set_altitude(self, v, load=False): + """ + Setter method for altitude, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/geolocation/altitude (int64) + If this variable is read-only (config: false) in the + source YANG file, then _set_altitude is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_altitude() directly. + + YANG Description: Distance above sea level. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64), is_leaf=True, yang_name="altitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """altitude must be of a type compatible with int64""", + 'defined-type': "int64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64), is_leaf=True, yang_name="altitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int64', is_config=False)""", + }) + + self.__altitude = t + if hasattr(self, '_set'): + self._set() + + def _unset_altitude(self): + self.__altitude = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64), is_leaf=True, yang_name="altitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int64', is_config=False) + + + def _get_latitude(self): + """ + Getter method for latitude, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/geolocation/latitude (geographic-coordinate-degree) + + YANG Description: Relative position north or south on the Earth's surface. + """ + return self.__latitude + + def _set_latitude(self, v, load=False): + """ + Setter method for latitude, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/geolocation/latitude (geographic-coordinate-degree) + If this variable is read-only (config: false) in the + source YANG file, then _set_latitude is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_latitude() directly. + + YANG Description: Relative position north or south on the Earth's surface. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-90..90']}), is_leaf=True, yang_name="latitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """latitude must be of a type compatible with geographic-coordinate-degree""", + 'defined-type': "ietf-te-topology:geographic-coordinate-degree", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-90..90']}), is_leaf=True, yang_name="latitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False)""", + }) + + self.__latitude = t + if hasattr(self, '_set'): + self._set() + + def _unset_latitude(self): + self.__latitude = YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-90..90']}), is_leaf=True, yang_name="latitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False) + + + def _get_longitude(self): + """ + Getter method for longitude, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/geolocation/longitude (geographic-coordinate-degree) + + YANG Description: Angular distance east or west on the Earth's surface. + """ + return self.__longitude + + def _set_longitude(self, v, load=False): + """ + Setter method for longitude, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/geolocation/longitude (geographic-coordinate-degree) + If this variable is read-only (config: false) in the + source YANG file, then _set_longitude is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_longitude() directly. + + YANG Description: Angular distance east or west on the Earth's surface. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-180..180']}), is_leaf=True, yang_name="longitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """longitude must be of a type compatible with geographic-coordinate-degree""", + 'defined-type': "ietf-te-topology:geographic-coordinate-degree", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-180..180']}), is_leaf=True, yang_name="longitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False)""", + }) + + self.__longitude = t + if hasattr(self, '_set'): + self._set() + + def _unset_longitude(self): + self.__longitude = YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-180..180']}), is_leaf=True, yang_name="longitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False) + + altitude = __builtin__.property(_get_altitude) + latitude = __builtin__.property(_get_latitude) + longitude = __builtin__.property(_get_longitude) + + + _pyangbind_elements = OrderedDict([('altitude', altitude), ('latitude', latitude), ('longitude', longitude), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/__init__.py new file mode 100644 index 000000000..309e87f52 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/__init__.py @@ -0,0 +1,418 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import label_restrictions +from . import underlay +from . import path_constraints +from . import optimizations +from . import path_properties +from . import local_link_connectivity +class local_link_connectivities(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains an LLCL for a TTP on a TE node. + """ + __slots__ = ('_path_helper', '_extmethods', '__number_of_entries','__label_restrictions','__is_allowed','__underlay','__path_constraints','__optimizations','__path_properties','__local_link_connectivity',) + + _yang_name = 'local-link-connectivities' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__number_of_entries = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number-of-entries", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=True) + self.__label_restrictions = YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__is_allowed = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + self.__underlay = YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_constraints = YANGDynClass(base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__optimizations = YANGDynClass(base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_properties = YANGDynClass(base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__local_link_connectivity = YANGDynClass(base=YANGListType("link_tp_ref",local_link_connectivity.local_link_connectivity, yang_name="local-link-connectivity", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='link-tp-ref', extensions=None), is_container='list', yang_name="local-link-connectivity", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities'] + + def _get_number_of_entries(self): + """ + Getter method for number_of_entries, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/number_of_entries (uint16) + + YANG Description: The number of LLCL entries. +If this number is specified in the configuration request, +the number is the requested number of entries, which may +not all be listed in the list; +if this number is reported in the state data, +the number is the current number of operational entries. + """ + return self.__number_of_entries + + def _set_number_of_entries(self, v, load=False): + """ + Setter method for number_of_entries, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/number_of_entries (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_number_of_entries is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_number_of_entries() directly. + + YANG Description: The number of LLCL entries. +If this number is specified in the configuration request, +the number is the requested number of entries, which may +not all be listed in the list; +if this number is reported in the state data, +the number is the current number of operational entries. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number-of-entries", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """number_of_entries must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number-of-entries", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=True)""", + }) + + self.__number_of_entries = t + if hasattr(self, '_set'): + self._set() + + def _unset_number_of_entries(self): + self.__number_of_entries = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number-of-entries", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=True) + + + def _get_label_restrictions(self): + """ + Getter method for label_restrictions, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions (container) + + YANG Description: The label restrictions container. + """ + return self.__label_restrictions + + def _set_label_restrictions(self, v, load=False): + """ + Setter method for label_restrictions, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_restrictions is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_restrictions() directly. + + YANG Description: The label restrictions container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_restrictions must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_restrictions = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_restrictions(self): + self.__label_restrictions = YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_is_allowed(self): + """ + Getter method for is_allowed, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/is_allowed (boolean) + + YANG Description: 'true' - switching is allowed; +'false' - switching is disallowed. + """ + return self.__is_allowed + + def _set_is_allowed(self, v, load=False): + """ + Setter method for is_allowed, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/is_allowed (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_is_allowed is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_is_allowed() directly. + + YANG Description: 'true' - switching is allowed; +'false' - switching is disallowed. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """is_allowed must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__is_allowed = t + if hasattr(self, '_set'): + self._set() + + def _unset_is_allowed(self): + self.__is_allowed = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + + def _get_underlay(self): + """ + Getter method for underlay, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay (container) + + YANG Description: Attributes of the TE link underlay. + """ + return self.__underlay + + def _set_underlay(self, v, load=False): + """ + Setter method for underlay, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_underlay is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_underlay() directly. + + YANG Description: Attributes of the TE link underlay. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """underlay must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__underlay = t + if hasattr(self, '_set'): + self._set() + + def _unset_underlay(self): + self.__underlay = YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_constraints(self): + """ + Getter method for path_constraints, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints (container) + + YANG Description: TE named path constraints container. + """ + return self.__path_constraints + + def _set_path_constraints(self, v, load=False): + """ + Setter method for path_constraints, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_constraints is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_constraints() directly. + + YANG Description: TE named path constraints container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_constraints must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_constraints = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_constraints(self): + self.__path_constraints = YANGDynClass(base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_optimizations(self): + """ + Getter method for optimizations, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations (container) + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + return self.__optimizations + + def _set_optimizations(self, v, load=False): + """ + Setter method for optimizations, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_optimizations is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_optimizations() directly. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """optimizations must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__optimizations = t + if hasattr(self, '_set'): + self._set() + + def _unset_optimizations(self): + self.__optimizations = YANGDynClass(base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_properties(self): + """ + Getter method for path_properties, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties (container) + + YANG Description: The TE path properties. + """ + return self.__path_properties + + def _set_path_properties(self, v, load=False): + """ + Setter method for path_properties, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_properties is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_properties() directly. + + YANG Description: The TE path properties. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_properties must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_properties = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_properties(self): + self.__path_properties = YANGDynClass(base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_local_link_connectivity(self): + """ + Getter method for local_link_connectivity, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity (list) + + YANG Description: The termination capabilities between the TTP and the LTP. +This capability information can be used to compute +the tunnel path. +The Interface Adjustment Capability Descriptors (IACDs) +(defined in RFC 6001) on each LTP can be derived from +this list. + """ + return self.__local_link_connectivity + + def _set_local_link_connectivity(self, v, load=False): + """ + Setter method for local_link_connectivity, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_local_link_connectivity is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_local_link_connectivity() directly. + + YANG Description: The termination capabilities between the TTP and the LTP. +This capability information can be used to compute +the tunnel path. +The Interface Adjustment Capability Descriptors (IACDs) +(defined in RFC 6001) on each LTP can be derived from +this list. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("link_tp_ref",local_link_connectivity.local_link_connectivity, yang_name="local-link-connectivity", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='link-tp-ref', extensions=None), is_container='list', yang_name="local-link-connectivity", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """local_link_connectivity must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("link_tp_ref",local_link_connectivity.local_link_connectivity, yang_name="local-link-connectivity", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='link-tp-ref', extensions=None), is_container='list', yang_name="local-link-connectivity", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__local_link_connectivity = t + if hasattr(self, '_set'): + self._set() + + def _unset_local_link_connectivity(self): + self.__local_link_connectivity = YANGDynClass(base=YANGListType("link_tp_ref",local_link_connectivity.local_link_connectivity, yang_name="local-link-connectivity", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='link-tp-ref', extensions=None), is_container='list', yang_name="local-link-connectivity", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + number_of_entries = __builtin__.property(_get_number_of_entries, _set_number_of_entries) + label_restrictions = __builtin__.property(_get_label_restrictions, _set_label_restrictions) + is_allowed = __builtin__.property(_get_is_allowed, _set_is_allowed) + underlay = __builtin__.property(_get_underlay, _set_underlay) + path_constraints = __builtin__.property(_get_path_constraints, _set_path_constraints) + optimizations = __builtin__.property(_get_optimizations, _set_optimizations) + path_properties = __builtin__.property(_get_path_properties) + local_link_connectivity = __builtin__.property(_get_local_link_connectivity, _set_local_link_connectivity) + + + _pyangbind_elements = OrderedDict([('number_of_entries', number_of_entries), ('label_restrictions', label_restrictions), ('is_allowed', is_allowed), ('underlay', underlay), ('path_constraints', path_constraints), ('optimizations', optimizations), ('path_properties', path_properties), ('local_link_connectivity', local_link_connectivity), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/__init__.py new file mode 100644 index 000000000..7170e4798 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/__init__.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import label_restriction +class label_restrictions(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/label-restrictions. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The label restrictions container. + """ + __slots__ = ('_path_helper', '_extmethods', '__label_restriction',) + + _yang_name = 'label-restrictions' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__label_restriction = YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'label-restrictions'] + + def _get_label_restriction(self): + """ + Getter method for label_restriction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction (list) + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + return self.__label_restriction + + def _set_label_restriction(self, v, load=False): + """ + Setter method for label_restriction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_restriction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_restriction() directly. + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_restriction must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__label_restriction = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_restriction(self): + self.__label_restriction = YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + label_restriction = __builtin__.property(_get_label_restriction, _set_label_restriction) + + + _pyangbind_elements = OrderedDict([('label_restriction', label_restriction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/__init__.py new file mode 100644 index 000000000..6bb6db97a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/__init__.py @@ -0,0 +1,450 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import label_start +from . import label_end +from . import label_step +from . import otn_label_range +from . import ethernet_label_range +class label_restriction(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/label-restrictions/label-restriction. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + __slots__ = ('_path_helper', '_extmethods', '__restriction','__index','__label_start','__label_end','__label_step','__range_bitmap','__otn_label_range','__ethernet_label_range',) + + _yang_name = 'label-restriction' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__restriction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__label_start = YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_end = YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_step = YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__range_bitmap = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True) + self.__otn_label_range = YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__ethernet_label_range = YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'label-restrictions', 'label-restriction'] + + def _get_restriction(self): + """ + Getter method for restriction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/restriction (enumeration) + + YANG Description: Indicates whether the list item is inclusive or exclusive. + """ + return self.__restriction + + def _set_restriction(self, v, load=False): + """ + Setter method for restriction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/restriction (enumeration) + If this variable is read-only (config: false) in the + source YANG file, then _set_restriction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_restriction() directly. + + YANG Description: Indicates whether the list item is inclusive or exclusive. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """restriction must be of a type compatible with enumeration""", + 'defined-type': "ietf-te-topology:enumeration", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True)""", + }) + + self.__restriction = t + if hasattr(self, '_set'): + self._set() + + def _unset_restriction(self): + self.__restriction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/index (uint32) + + YANG Description: The index of the label restriction list entry. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/index (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: The index of the label restriction list entry. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_label_start(self): + """ + Getter method for label_start, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start (container) + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + return self.__label_start + + def _set_label_start(self, v, load=False): + """ + Setter method for label_start, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_start is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_start() directly. + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_start must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_start = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_start(self): + self.__label_start = YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_end(self): + """ + Getter method for label_end, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end (container) + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + return self.__label_end + + def _set_label_end(self, v, load=False): + """ + Setter method for label_end, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_end is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_end() directly. + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_end must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_end = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_end(self): + self.__label_end = YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_step(self): + """ + Getter method for label_step, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step (container) + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + return self.__label_step + + def _set_label_step(self, v, load=False): + """ + Setter method for label_step, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_step is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_step() directly. + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_step must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_step = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_step(self): + self.__label_step = YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_range_bitmap(self): + """ + Getter method for range_bitmap, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/range_bitmap (yang:hex-string) + + YANG Description: When there are gaps between 'label-start' and 'label-end', +this attribute is used to specify the positions +of the used labels. This is represented in big endian as +'hex-string'. +The most significant byte in the hex-string is the farthest +to the left in the byte sequence. Leading zero bytes in the +configured value may be omitted for brevity. +Each bit position in the 'range-bitmap' 'hex-string' maps +to a label in the range derived from 'label-start'. + +For example, assuming that 'label-start' = 16000 and +'range-bitmap' = 0x01000001, then: + +- bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. +- bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1. + """ + return self.__range_bitmap + + def _set_range_bitmap(self, v, load=False): + """ + Setter method for range_bitmap, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/range_bitmap (yang:hex-string) + If this variable is read-only (config: false) in the + source YANG file, then _set_range_bitmap is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_range_bitmap() directly. + + YANG Description: When there are gaps between 'label-start' and 'label-end', +this attribute is used to specify the positions +of the used labels. This is represented in big endian as +'hex-string'. +The most significant byte in the hex-string is the farthest +to the left in the byte sequence. Leading zero bytes in the +configured value may be omitted for brevity. +Each bit position in the 'range-bitmap' 'hex-string' maps +to a label in the range derived from 'label-start'. + +For example, assuming that 'label-start' = 16000 and +'range-bitmap' = 0x01000001, then: + +- bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. +- bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """range_bitmap must be of a type compatible with yang:hex-string""", + 'defined-type': "yang:hex-string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True)""", + }) + + self.__range_bitmap = t + if hasattr(self, '_set'): + self._set() + + def _unset_range_bitmap(self): + self.__range_bitmap = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True) + + + def _get_otn_label_range(self): + """ + Getter method for otn_label_range, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/otn_label_range (container) + + YANG Description: Label range information for OTN. + """ + return self.__otn_label_range + + def _set_otn_label_range(self, v, load=False): + """ + Setter method for otn_label_range, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/otn_label_range (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn_label_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn_label_range() directly. + + YANG Description: Label range information for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn_label_range must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn_label_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn_label_range(self): + self.__otn_label_range = YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_ethernet_label_range(self): + """ + Getter method for ethernet_label_range, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/ethernet_label_range (container) + + YANG Description: Ethernet-specific label range related information. + """ + return self.__ethernet_label_range + + def _set_ethernet_label_range(self, v, load=False): + """ + Setter method for ethernet_label_range, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/ethernet_label_range (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_ethernet_label_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ethernet_label_range() directly. + + YANG Description: Ethernet-specific label range related information. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ethernet_label_range must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True)""", + }) + + self.__ethernet_label_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_ethernet_label_range(self): + self.__ethernet_label_range = YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + restriction = __builtin__.property(_get_restriction, _set_restriction) + index = __builtin__.property(_get_index, _set_index) + label_start = __builtin__.property(_get_label_start, _set_label_start) + label_end = __builtin__.property(_get_label_end, _set_label_end) + label_step = __builtin__.property(_get_label_step, _set_label_step) + range_bitmap = __builtin__.property(_get_range_bitmap, _set_range_bitmap) + otn_label_range = __builtin__.property(_get_otn_label_range, _set_otn_label_range) + ethernet_label_range = __builtin__.property(_get_ethernet_label_range, _set_ethernet_label_range) + + + _pyangbind_elements = OrderedDict([('restriction', restriction), ('index', index), ('label_start', label_start), ('label_end', label_end), ('label_step', label_step), ('range_bitmap', range_bitmap), ('otn_label_range', otn_label_range), ('ethernet_label_range', ethernet_label_range), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/ethernet_label_range/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/ethernet_label_range/__init__.py new file mode 100644 index 000000000..3ee376c6a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/ethernet_label_range/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class ethernet_label_range(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/label-restrictions/label-restriction/ethernet-label-range. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Ethernet-specific label range related information. + """ + __slots__ = ('_path_helper', '_extmethods', '__tag_type','__priority',) + + _yang_name = 'ethernet-label-range' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tag_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'label-restrictions', 'label-restriction', 'ethernet-label-range'] + + def _get_tag_type(self): + """ + Getter method for tag_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/ethernet_label_range/tag_type (etht-types:eth-tag-type) + + YANG Description: VLAN tag type. + """ + return self.__tag_type + + def _set_tag_type(self, v, load=False): + """ + Setter method for tag_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/ethernet_label_range/tag_type (etht-types:eth-tag-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_tag_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tag_type() directly. + + YANG Description: VLAN tag type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tag_type must be of a type compatible with etht-types:eth-tag-type""", + 'defined-type': "etht-types:eth-tag-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True)""", + }) + + self.__tag_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_tag_type(self): + self.__tag_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/ethernet_label_range/priority (uint8) + + YANG Description: priority. + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/ethernet_label_range/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: priority. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True) + + tag_type = __builtin__.property(_get_tag_type, _set_tag_type) + priority = __builtin__.property(_get_priority, _set_priority) + + + _pyangbind_elements = OrderedDict([('tag_type', tag_type), ('priority', priority), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/__init__.py new file mode 100644 index 000000000..e6bcde2cf --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/__init__.py @@ -0,0 +1,119 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_end(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/label-restrictions/label-restriction/label-end. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-end' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'label-restrictions', 'label-restriction', 'label-end'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/__init__.py new file mode 100644 index 000000000..d964dca5c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/label-restrictions/label-restriction/label-end/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'label-restrictions', 'label-restriction', 'label-end', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/otn (container) + + YANG Description: Label start or label end for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label start or label end for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py new file mode 100644 index 000000000..360a12234 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/label-restrictions/label-restriction/label-end/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label start or label end for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'label-restrictions', 'label-restriction', 'label-end', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/otn/ts (otn-ts) + + YANG Description: Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_end/te_label/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + ts = __builtin__.property(_get_ts, _set_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/__init__.py new file mode 100644 index 000000000..438d60e5b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/__init__.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_start(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/label-restrictions/label-restriction/label-start. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-start' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'label-restrictions', 'label-restriction', 'label-start'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/__init__.py new file mode 100644 index 000000000..8e14efa20 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/label-restrictions/label-restriction/label-start/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'label-restrictions', 'label-restriction', 'label-start', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/otn (container) + + YANG Description: Label start or label end for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label start or label end for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py new file mode 100644 index 000000000..56b84bbbd --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/label-restrictions/label-restriction/label-start/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label start or label end for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'label-restrictions', 'label-restriction', 'label-start', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/otn/ts (otn-ts) + + YANG Description: Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_start/te_label/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + ts = __builtin__.property(_get_ts, _set_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/__init__.py new file mode 100644 index 000000000..c349c4d91 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/__init__.py @@ -0,0 +1,200 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class label_step(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/label-restrictions/label-restriction/label-step. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_step',) + + _yang_name = 'label-step' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__eth_step = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'label-restrictions', 'label-restriction', 'label-step'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/generic (int32) + + YANG Description: Label range step. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/generic (int32) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Label range step. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with int32""", + 'defined-type': "int32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/otn (container) + + YANG Description: Label step for OTN + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label step for OTN + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_eth_step(self): + """ + Getter method for eth_step, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/eth_step (uint16) + + YANG Description: Label step which represent possible increments for +an Ethernet VLAN tag. + """ + return self.__eth_step + + def _set_eth_step(self, v, load=False): + """ + Setter method for eth_step, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/eth_step (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_step is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_step() directly. + + YANG Description: Label step which represent possible increments for +an Ethernet VLAN tag. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_step must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True)""", + }) + + self.__eth_step = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_step(self): + self.__eth_step = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + eth_step = __builtin__.property(_get_eth_step, _set_eth_step) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['eth_step']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_step', eth_step), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/otn/__init__.py new file mode 100644 index 000000000..0a0f6d7ae --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/otn/__init__.py @@ -0,0 +1,158 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/label-restrictions/label-restriction/label-step/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label step for OTN + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'label-restrictions', 'label-restriction', 'label-step', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/otn/tpn (otn-tpn) + + YANG Description: Label step which represents possible increments for +Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Label step which represents possible increments for +Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/otn/ts (otn-ts) + + YANG Description: Label step which represents possible increments for +Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/label_step/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Label step which represents possible increments for +Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + ts = __builtin__.property(_get_ts, _set_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/otn_label_range/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/otn_label_range/__init__.py new file mode 100644 index 000000000..bfc2cd1e0 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/otn_label_range/__init__.py @@ -0,0 +1,256 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn_label_range(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/label-restrictions/label-restriction/otn-label-range. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label range information for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__range_type','__tsg','__odu_type_list','__priority',) + + _yang_name = 'otn-label-range' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__range_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__odu_type_list = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'label-restrictions', 'label-restriction', 'otn-label-range'] + + def _get_range_type(self): + """ + Getter method for range_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/otn_label_range/range_type (otn-label-range-type) + + YANG Description: The type of range (e.g., TPN or TS) +to which the label range applies + """ + return self.__range_type + + def _set_range_type(self, v, load=False): + """ + Setter method for range_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/otn_label_range/range_type (otn-label-range-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_range_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_range_type() directly. + + YANG Description: The type of range (e.g., TPN or TS) +to which the label range applies + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """range_type must be of a type compatible with otn-label-range-type""", + 'defined-type': "ietf-otn-topology:otn-label-range-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True)""", + }) + + self.__range_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_range_type(self): + self.__range_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/otn_label_range/tsg (identityref) + + YANG Description: Tributary slot granularity (TSG) to which the label range +applies. + +This leaf MUST be present when the range-type is TS. + +This leaf MAY be omitted when mapping an ODUk over an OTUk +Link. In this case the range-type is tpn, with only one +entry (ODUk), and the tpn range has only one value (1). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/otn_label_range/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary slot granularity (TSG) to which the label range +applies. + +This leaf MUST be present when the range-type is TS. + +This leaf MAY be omitted when mapping an ODUk over an OTUk +Link. In this case the range-type is tpn, with only one +entry (ODUk), and the tpn range has only one value (1). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_odu_type_list(self): + """ + Getter method for odu_type_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/otn_label_range/odu_type_list (identityref) + + YANG Description: List of ODU types to which the label range applies. + +An Empty odu-type-list means that the label range +applies to all the supported ODU types. + """ + return self.__odu_type_list + + def _set_odu_type_list(self, v, load=False): + """ + Setter method for odu_type_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/otn_label_range/odu_type_list (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type_list() directly. + + YANG Description: List of ODU types to which the label range applies. + +An Empty odu-type-list means that the label range +applies to all the supported ODU types. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type_list must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__odu_type_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type_list(self): + self.__odu_type_list = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/otn_label_range/priority (uint8) + + YANG Description: Priority in Interface Switching Capability +Descriptor (ISCD). + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/label_restrictions/label_restriction/otn_label_range/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: Priority in Interface Switching Capability +Descriptor (ISCD). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True) + + range_type = __builtin__.property(_get_range_type, _set_range_type) + tsg = __builtin__.property(_get_tsg, _set_tsg) + odu_type_list = __builtin__.property(_get_odu_type_list, _set_odu_type_list) + priority = __builtin__.property(_get_priority, _set_priority) + + + _pyangbind_elements = OrderedDict([('range_type', range_type), ('tsg', tsg), ('odu_type_list', odu_type_list), ('priority', priority), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/__init__.py new file mode 100644 index 000000000..b7a646ea6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/__init__.py @@ -0,0 +1,368 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import label_restrictions +from . import underlay +from . import path_constraints +from . import optimizations +from . import path_properties +class local_link_connectivity(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The termination capabilities between the TTP and the LTP. +This capability information can be used to compute +the tunnel path. +The Interface Adjustment Capability Descriptors (IACDs) +(defined in RFC 6001) on each LTP can be derived from +this list. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_ref','__label_restrictions','__is_allowed','__underlay','__path_constraints','__optimizations','__path_properties',) + + _yang_name = 'local-link-connectivity' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="link-tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + self.__label_restrictions = YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__is_allowed = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + self.__underlay = YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_constraints = YANGDynClass(base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__optimizations = YANGDynClass(base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_properties = YANGDynClass(base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity'] + + def _get_link_tp_ref(self): + """ + Getter method for link_tp_ref, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/link_tp_ref (leafref) + + YANG Description: LTP. + """ + return self.__link_tp_ref + + def _set_link_tp_ref(self, v, load=False): + """ + Setter method for link_tp_ref, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/link_tp_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_ref() directly. + + YANG Description: LTP. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="link-tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="link-tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__link_tp_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_ref(self): + self.__link_tp_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="link-tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + + def _get_label_restrictions(self): + """ + Getter method for label_restrictions, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions (container) + + YANG Description: The label restrictions container. + """ + return self.__label_restrictions + + def _set_label_restrictions(self, v, load=False): + """ + Setter method for label_restrictions, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_restrictions is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_restrictions() directly. + + YANG Description: The label restrictions container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_restrictions must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_restrictions = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_restrictions(self): + self.__label_restrictions = YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_is_allowed(self): + """ + Getter method for is_allowed, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/is_allowed (boolean) + + YANG Description: 'true' - switching is allowed; +'false' - switching is disallowed. + """ + return self.__is_allowed + + def _set_is_allowed(self, v, load=False): + """ + Setter method for is_allowed, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/is_allowed (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_is_allowed is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_is_allowed() directly. + + YANG Description: 'true' - switching is allowed; +'false' - switching is disallowed. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """is_allowed must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__is_allowed = t + if hasattr(self, '_set'): + self._set() + + def _unset_is_allowed(self): + self.__is_allowed = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-allowed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + + def _get_underlay(self): + """ + Getter method for underlay, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay (container) + + YANG Description: Attributes of the TE link underlay. + """ + return self.__underlay + + def _set_underlay(self, v, load=False): + """ + Setter method for underlay, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_underlay is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_underlay() directly. + + YANG Description: Attributes of the TE link underlay. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """underlay must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__underlay = t + if hasattr(self, '_set'): + self._set() + + def _unset_underlay(self): + self.__underlay = YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_constraints(self): + """ + Getter method for path_constraints, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints (container) + + YANG Description: TE named path constraints container. + """ + return self.__path_constraints + + def _set_path_constraints(self, v, load=False): + """ + Setter method for path_constraints, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_constraints is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_constraints() directly. + + YANG Description: TE named path constraints container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_constraints must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_constraints = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_constraints(self): + self.__path_constraints = YANGDynClass(base=path_constraints.path_constraints, is_container='container', yang_name="path-constraints", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_optimizations(self): + """ + Getter method for optimizations, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations (container) + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + return self.__optimizations + + def _set_optimizations(self, v, load=False): + """ + Setter method for optimizations, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_optimizations is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_optimizations() directly. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """optimizations must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__optimizations = t + if hasattr(self, '_set'): + self._set() + + def _unset_optimizations(self): + self.__optimizations = YANGDynClass(base=optimizations.optimizations, is_container='container', yang_name="optimizations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_properties(self): + """ + Getter method for path_properties, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties (container) + + YANG Description: The TE path properties. + """ + return self.__path_properties + + def _set_path_properties(self, v, load=False): + """ + Setter method for path_properties, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_properties is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_properties() directly. + + YANG Description: The TE path properties. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_properties must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_properties = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_properties(self): + self.__path_properties = YANGDynClass(base=path_properties.path_properties, is_container='container', yang_name="path-properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + link_tp_ref = __builtin__.property(_get_link_tp_ref, _set_link_tp_ref) + label_restrictions = __builtin__.property(_get_label_restrictions, _set_label_restrictions) + is_allowed = __builtin__.property(_get_is_allowed, _set_is_allowed) + underlay = __builtin__.property(_get_underlay, _set_underlay) + path_constraints = __builtin__.property(_get_path_constraints, _set_path_constraints) + optimizations = __builtin__.property(_get_optimizations, _set_optimizations) + path_properties = __builtin__.property(_get_path_properties) + + + _pyangbind_elements = OrderedDict([('link_tp_ref', link_tp_ref), ('label_restrictions', label_restrictions), ('is_allowed', is_allowed), ('underlay', underlay), ('path_constraints', path_constraints), ('optimizations', optimizations), ('path_properties', path_properties), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/__init__.py new file mode 100644 index 000000000..37d7f23f2 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/__init__.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import label_restriction +class label_restrictions(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/label-restrictions. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The label restrictions container. + """ + __slots__ = ('_path_helper', '_extmethods', '__label_restriction',) + + _yang_name = 'label-restrictions' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__label_restriction = YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'label-restrictions'] + + def _get_label_restriction(self): + """ + Getter method for label_restriction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction (list) + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + return self.__label_restriction + + def _set_label_restriction(self, v, load=False): + """ + Setter method for label_restriction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_restriction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_restriction() directly. + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_restriction must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__label_restriction = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_restriction(self): + self.__label_restriction = YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + label_restriction = __builtin__.property(_get_label_restriction, _set_label_restriction) + + + _pyangbind_elements = OrderedDict([('label_restriction', label_restriction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/__init__.py new file mode 100644 index 000000000..5d5f6509b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/__init__.py @@ -0,0 +1,450 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import label_start +from . import label_end +from . import label_step +from . import otn_label_range +from . import ethernet_label_range +class label_restriction(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/label-restrictions/label-restriction. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + __slots__ = ('_path_helper', '_extmethods', '__restriction','__index','__label_start','__label_end','__label_step','__range_bitmap','__otn_label_range','__ethernet_label_range',) + + _yang_name = 'label-restriction' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__restriction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__label_start = YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_end = YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_step = YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__range_bitmap = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True) + self.__otn_label_range = YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__ethernet_label_range = YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'label-restrictions', 'label-restriction'] + + def _get_restriction(self): + """ + Getter method for restriction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/restriction (enumeration) + + YANG Description: Indicates whether the list item is inclusive or exclusive. + """ + return self.__restriction + + def _set_restriction(self, v, load=False): + """ + Setter method for restriction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/restriction (enumeration) + If this variable is read-only (config: false) in the + source YANG file, then _set_restriction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_restriction() directly. + + YANG Description: Indicates whether the list item is inclusive or exclusive. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """restriction must be of a type compatible with enumeration""", + 'defined-type': "ietf-te-topology:enumeration", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True)""", + }) + + self.__restriction = t + if hasattr(self, '_set'): + self._set() + + def _unset_restriction(self): + self.__restriction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/index (uint32) + + YANG Description: The index of the label restriction list entry. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/index (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: The index of the label restriction list entry. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_label_start(self): + """ + Getter method for label_start, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start (container) + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + return self.__label_start + + def _set_label_start(self, v, load=False): + """ + Setter method for label_start, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_start is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_start() directly. + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_start must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_start = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_start(self): + self.__label_start = YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_end(self): + """ + Getter method for label_end, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end (container) + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + return self.__label_end + + def _set_label_end(self, v, load=False): + """ + Setter method for label_end, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_end is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_end() directly. + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_end must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_end = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_end(self): + self.__label_end = YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_step(self): + """ + Getter method for label_step, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step (container) + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + return self.__label_step + + def _set_label_step(self, v, load=False): + """ + Setter method for label_step, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_step is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_step() directly. + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_step must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_step = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_step(self): + self.__label_step = YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_range_bitmap(self): + """ + Getter method for range_bitmap, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/range_bitmap (yang:hex-string) + + YANG Description: When there are gaps between 'label-start' and 'label-end', +this attribute is used to specify the positions +of the used labels. This is represented in big endian as +'hex-string'. +The most significant byte in the hex-string is the farthest +to the left in the byte sequence. Leading zero bytes in the +configured value may be omitted for brevity. +Each bit position in the 'range-bitmap' 'hex-string' maps +to a label in the range derived from 'label-start'. + +For example, assuming that 'label-start' = 16000 and +'range-bitmap' = 0x01000001, then: + +- bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. +- bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1. + """ + return self.__range_bitmap + + def _set_range_bitmap(self, v, load=False): + """ + Setter method for range_bitmap, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/range_bitmap (yang:hex-string) + If this variable is read-only (config: false) in the + source YANG file, then _set_range_bitmap is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_range_bitmap() directly. + + YANG Description: When there are gaps between 'label-start' and 'label-end', +this attribute is used to specify the positions +of the used labels. This is represented in big endian as +'hex-string'. +The most significant byte in the hex-string is the farthest +to the left in the byte sequence. Leading zero bytes in the +configured value may be omitted for brevity. +Each bit position in the 'range-bitmap' 'hex-string' maps +to a label in the range derived from 'label-start'. + +For example, assuming that 'label-start' = 16000 and +'range-bitmap' = 0x01000001, then: + +- bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. +- bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """range_bitmap must be of a type compatible with yang:hex-string""", + 'defined-type': "yang:hex-string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True)""", + }) + + self.__range_bitmap = t + if hasattr(self, '_set'): + self._set() + + def _unset_range_bitmap(self): + self.__range_bitmap = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True) + + + def _get_otn_label_range(self): + """ + Getter method for otn_label_range, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/otn_label_range (container) + + YANG Description: Label range information for OTN. + """ + return self.__otn_label_range + + def _set_otn_label_range(self, v, load=False): + """ + Setter method for otn_label_range, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/otn_label_range (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn_label_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn_label_range() directly. + + YANG Description: Label range information for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn_label_range must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn_label_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn_label_range(self): + self.__otn_label_range = YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_ethernet_label_range(self): + """ + Getter method for ethernet_label_range, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/ethernet_label_range (container) + + YANG Description: Ethernet-specific label range related information. + """ + return self.__ethernet_label_range + + def _set_ethernet_label_range(self, v, load=False): + """ + Setter method for ethernet_label_range, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/ethernet_label_range (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_ethernet_label_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ethernet_label_range() directly. + + YANG Description: Ethernet-specific label range related information. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ethernet_label_range must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True)""", + }) + + self.__ethernet_label_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_ethernet_label_range(self): + self.__ethernet_label_range = YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + restriction = __builtin__.property(_get_restriction, _set_restriction) + index = __builtin__.property(_get_index, _set_index) + label_start = __builtin__.property(_get_label_start, _set_label_start) + label_end = __builtin__.property(_get_label_end, _set_label_end) + label_step = __builtin__.property(_get_label_step, _set_label_step) + range_bitmap = __builtin__.property(_get_range_bitmap, _set_range_bitmap) + otn_label_range = __builtin__.property(_get_otn_label_range, _set_otn_label_range) + ethernet_label_range = __builtin__.property(_get_ethernet_label_range, _set_ethernet_label_range) + + + _pyangbind_elements = OrderedDict([('restriction', restriction), ('index', index), ('label_start', label_start), ('label_end', label_end), ('label_step', label_step), ('range_bitmap', range_bitmap), ('otn_label_range', otn_label_range), ('ethernet_label_range', ethernet_label_range), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/ethernet_label_range/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/ethernet_label_range/__init__.py new file mode 100644 index 000000000..17b2f661d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/ethernet_label_range/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class ethernet_label_range(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/label-restrictions/label-restriction/ethernet-label-range. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Ethernet-specific label range related information. + """ + __slots__ = ('_path_helper', '_extmethods', '__tag_type','__priority',) + + _yang_name = 'ethernet-label-range' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tag_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'label-restrictions', 'label-restriction', 'ethernet-label-range'] + + def _get_tag_type(self): + """ + Getter method for tag_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/ethernet_label_range/tag_type (etht-types:eth-tag-type) + + YANG Description: VLAN tag type. + """ + return self.__tag_type + + def _set_tag_type(self, v, load=False): + """ + Setter method for tag_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/ethernet_label_range/tag_type (etht-types:eth-tag-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_tag_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tag_type() directly. + + YANG Description: VLAN tag type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tag_type must be of a type compatible with etht-types:eth-tag-type""", + 'defined-type': "etht-types:eth-tag-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True)""", + }) + + self.__tag_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_tag_type(self): + self.__tag_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/ethernet_label_range/priority (uint8) + + YANG Description: priority. + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/ethernet_label_range/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: priority. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True) + + tag_type = __builtin__.property(_get_tag_type, _set_tag_type) + priority = __builtin__.property(_get_priority, _set_priority) + + + _pyangbind_elements = OrderedDict([('tag_type', tag_type), ('priority', priority), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/__init__.py new file mode 100644 index 000000000..c31cb6145 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/__init__.py @@ -0,0 +1,119 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_end(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/label-restrictions/label-restriction/label-end. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-end' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'label-restrictions', 'label-restriction', 'label-end'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/__init__.py new file mode 100644 index 000000000..deb12db62 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/label-restrictions/label-restriction/label-end/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'label-restrictions', 'label-restriction', 'label-end', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/otn (container) + + YANG Description: Label start or label end for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label start or label end for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py new file mode 100644 index 000000000..efd7f3ed2 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/label-restrictions/label-restriction/label-end/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label start or label end for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'label-restrictions', 'label-restriction', 'label-end', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/otn/ts (otn-ts) + + YANG Description: Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_end/te_label/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + ts = __builtin__.property(_get_ts, _set_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/__init__.py new file mode 100644 index 000000000..824467f81 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/__init__.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_start(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/label-restrictions/label-restriction/label-start. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-start' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'label-restrictions', 'label-restriction', 'label-start'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/__init__.py new file mode 100644 index 000000000..7fddd85cf --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/label-restrictions/label-restriction/label-start/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'label-restrictions', 'label-restriction', 'label-start', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/otn (container) + + YANG Description: Label start or label end for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label start or label end for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py new file mode 100644 index 000000000..44028d6f9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/label-restrictions/label-restriction/label-start/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label start or label end for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'label-restrictions', 'label-restriction', 'label-start', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/otn/ts (otn-ts) + + YANG Description: Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_start/te_label/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + ts = __builtin__.property(_get_ts, _set_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/__init__.py new file mode 100644 index 000000000..58c0b9c3e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/__init__.py @@ -0,0 +1,200 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class label_step(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/label-restrictions/label-restriction/label-step. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_step',) + + _yang_name = 'label-step' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__eth_step = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'label-restrictions', 'label-restriction', 'label-step'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/generic (int32) + + YANG Description: Label range step. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/generic (int32) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Label range step. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with int32""", + 'defined-type': "int32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/otn (container) + + YANG Description: Label step for OTN + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label step for OTN + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_eth_step(self): + """ + Getter method for eth_step, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/eth_step (uint16) + + YANG Description: Label step which represent possible increments for +an Ethernet VLAN tag. + """ + return self.__eth_step + + def _set_eth_step(self, v, load=False): + """ + Setter method for eth_step, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/eth_step (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_step is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_step() directly. + + YANG Description: Label step which represent possible increments for +an Ethernet VLAN tag. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_step must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True)""", + }) + + self.__eth_step = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_step(self): + self.__eth_step = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + eth_step = __builtin__.property(_get_eth_step, _set_eth_step) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['eth_step']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_step', eth_step), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/otn/__init__.py new file mode 100644 index 000000000..7125ae3a2 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/otn/__init__.py @@ -0,0 +1,158 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/label-restrictions/label-restriction/label-step/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label step for OTN + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'label-restrictions', 'label-restriction', 'label-step', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/otn/tpn (otn-tpn) + + YANG Description: Label step which represents possible increments for +Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Label step which represents possible increments for +Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/otn/ts (otn-ts) + + YANG Description: Label step which represents possible increments for +Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/label_step/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Label step which represents possible increments for +Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + ts = __builtin__.property(_get_ts, _set_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/otn_label_range/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/otn_label_range/__init__.py new file mode 100644 index 000000000..54adb557b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/otn_label_range/__init__.py @@ -0,0 +1,256 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn_label_range(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/label-restrictions/label-restriction/otn-label-range. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label range information for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__range_type','__tsg','__odu_type_list','__priority',) + + _yang_name = 'otn-label-range' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__range_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__odu_type_list = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'label-restrictions', 'label-restriction', 'otn-label-range'] + + def _get_range_type(self): + """ + Getter method for range_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/otn_label_range/range_type (otn-label-range-type) + + YANG Description: The type of range (e.g., TPN or TS) +to which the label range applies + """ + return self.__range_type + + def _set_range_type(self, v, load=False): + """ + Setter method for range_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/otn_label_range/range_type (otn-label-range-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_range_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_range_type() directly. + + YANG Description: The type of range (e.g., TPN or TS) +to which the label range applies + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """range_type must be of a type compatible with otn-label-range-type""", + 'defined-type': "ietf-otn-topology:otn-label-range-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True)""", + }) + + self.__range_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_range_type(self): + self.__range_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/otn_label_range/tsg (identityref) + + YANG Description: Tributary slot granularity (TSG) to which the label range +applies. + +This leaf MUST be present when the range-type is TS. + +This leaf MAY be omitted when mapping an ODUk over an OTUk +Link. In this case the range-type is tpn, with only one +entry (ODUk), and the tpn range has only one value (1). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/otn_label_range/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary slot granularity (TSG) to which the label range +applies. + +This leaf MUST be present when the range-type is TS. + +This leaf MAY be omitted when mapping an ODUk over an OTUk +Link. In this case the range-type is tpn, with only one +entry (ODUk), and the tpn range has only one value (1). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_odu_type_list(self): + """ + Getter method for odu_type_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/otn_label_range/odu_type_list (identityref) + + YANG Description: List of ODU types to which the label range applies. + +An Empty odu-type-list means that the label range +applies to all the supported ODU types. + """ + return self.__odu_type_list + + def _set_odu_type_list(self, v, load=False): + """ + Setter method for odu_type_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/otn_label_range/odu_type_list (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type_list() directly. + + YANG Description: List of ODU types to which the label range applies. + +An Empty odu-type-list means that the label range +applies to all the supported ODU types. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type_list must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__odu_type_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type_list(self): + self.__odu_type_list = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/otn_label_range/priority (uint8) + + YANG Description: Priority in Interface Switching Capability +Descriptor (ISCD). + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/label_restrictions/label_restriction/otn_label_range/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: Priority in Interface Switching Capability +Descriptor (ISCD). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True) + + range_type = __builtin__.property(_get_range_type, _set_range_type) + tsg = __builtin__.property(_get_tsg, _set_tsg) + odu_type_list = __builtin__.property(_get_odu_type_list, _set_odu_type_list) + priority = __builtin__.property(_get_priority, _set_priority) + + + _pyangbind_elements = OrderedDict([('range_type', range_type), ('tsg', tsg), ('odu_type_list', odu_type_list), ('priority', priority), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/__init__.py new file mode 100644 index 000000000..3bc26167a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/__init__.py @@ -0,0 +1,199 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import optimization_metric +from . import tiebreakers +from . import objective_function +class optimizations(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + __slots__ = ('_path_helper', '_extmethods', '__optimization_metric','__tiebreakers','__objective_function',) + + _yang_name = 'optimizations' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__optimization_metric = YANGDynClass(base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + self.__tiebreakers = YANGDynClass(base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__objective_function = YANGDynClass(base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations'] + + def _get_optimization_metric(self): + """ + Getter method for optimization_metric, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric (list) + + YANG Description: TE path metric type. + """ + return self.__optimization_metric + + def _set_optimization_metric(self, v, load=False): + """ + Setter method for optimization_metric, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_optimization_metric is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_optimization_metric() directly. + + YANG Description: TE path metric type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """optimization_metric must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__optimization_metric = t + if hasattr(self, '_set'): + self._set() + + def _unset_optimization_metric(self): + self.__optimization_metric = YANGDynClass(base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + + def _get_tiebreakers(self): + """ + Getter method for tiebreakers, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/tiebreakers (container) + + YANG Description: Container for the list of tiebreakers. + """ + return self.__tiebreakers + + def _set_tiebreakers(self, v, load=False): + """ + Setter method for tiebreakers, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/tiebreakers (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tiebreakers is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tiebreakers() directly. + + YANG Description: Container for the list of tiebreakers. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tiebreakers must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__tiebreakers = t + if hasattr(self, '_set'): + self._set() + + def _unset_tiebreakers(self): + self.__tiebreakers = YANGDynClass(base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_objective_function(self): + """ + Getter method for objective_function, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/objective_function (container) + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + return self.__objective_function + + def _set_objective_function(self, v, load=False): + """ + Setter method for objective_function, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/objective_function (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_objective_function is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_objective_function() directly. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """objective_function must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__objective_function = t + if hasattr(self, '_set'): + self._set() + + def _unset_objective_function(self): + self.__objective_function = YANGDynClass(base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + optimization_metric = __builtin__.property(_get_optimization_metric, _set_optimization_metric) + tiebreakers = __builtin__.property(_get_tiebreakers, _set_tiebreakers) + objective_function = __builtin__.property(_get_objective_function, _set_objective_function) + + __choices__ = {'algorithm': {'metric': ['optimization_metric', 'tiebreakers'], 'objective-function': ['objective_function']}} + _pyangbind_elements = OrderedDict([('optimization_metric', optimization_metric), ('tiebreakers', tiebreakers), ('objective_function', objective_function), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/objective_function/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/objective_function/__init__.py new file mode 100644 index 000000000..302ed4830 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/objective_function/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class objective_function(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/objective-function. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + __slots__ = ('_path_helper', '_extmethods', '__objective_function_type',) + + _yang_name = 'objective-function' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__objective_function_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'objective-function'] + + def _get_objective_function_type(self): + """ + Getter method for objective_function_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/objective_function/objective_function_type (identityref) + + YANG Description: Objective function entry. + """ + return self.__objective_function_type + + def _set_objective_function_type(self, v, load=False): + """ + Setter method for objective_function_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/objective_function/objective_function_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_objective_function_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_objective_function_type() directly. + + YANG Description: Objective function entry. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """objective_function_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__objective_function_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_objective_function_type(self): + self.__objective_function_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + objective_function_type = __builtin__.property(_get_objective_function_type, _set_objective_function_type) + + __choices__ = {'algorithm': {'objective-function': ['objective_function_type']}} + _pyangbind_elements = OrderedDict([('objective_function_type', objective_function_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/__init__.py new file mode 100644 index 000000000..ef6ac03d4 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/__init__.py @@ -0,0 +1,241 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import explicit_route_exclude_objects +from . import explicit_route_include_objects +class optimization_metric(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/optimization-metric. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE path metric type. + """ + __slots__ = ('_path_helper', '_extmethods', '__metric_type','__weight','__explicit_route_exclude_objects','__explicit_route_include_objects',) + + _yang_name = 'optimization-metric' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__weight = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + self.__explicit_route_exclude_objects = YANGDynClass(base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__explicit_route_include_objects = YANGDynClass(base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'optimization-metric'] + + def _get_metric_type(self): + """ + Getter method for metric_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/metric_type (identityref) + + YANG Description: Identifies the 'metric-type' that the path computation +process uses for optimization. + """ + return self.__metric_type + + def _set_metric_type(self, v, load=False): + """ + Setter method for metric_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/metric_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_metric_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_metric_type() directly. + + YANG Description: Identifies the 'metric-type' that the path computation +process uses for optimization. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """metric_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__metric_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_metric_type(self): + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_weight(self): + """ + Getter method for weight, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/weight (uint8) + + YANG Description: TE path metric normalization weight. + """ + return self.__weight + + def _set_weight(self, v, load=False): + """ + Setter method for weight, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/weight (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_weight is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_weight() directly. + + YANG Description: TE path metric normalization weight. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """weight must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__weight = t + if hasattr(self, '_set'): + self._set() + + def _unset_weight(self): + self.__weight = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + + + def _get_explicit_route_exclude_objects(self): + """ + Getter method for explicit_route_exclude_objects, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects (container) + + YANG Description: Container for the 'exclude route' object list. + """ + return self.__explicit_route_exclude_objects + + def _set_explicit_route_exclude_objects(self, v, load=False): + """ + Setter method for explicit_route_exclude_objects, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_explicit_route_exclude_objects is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_explicit_route_exclude_objects() directly. + + YANG Description: Container for the 'exclude route' object list. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """explicit_route_exclude_objects must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__explicit_route_exclude_objects = t + if hasattr(self, '_set'): + self._set() + + def _unset_explicit_route_exclude_objects(self): + self.__explicit_route_exclude_objects = YANGDynClass(base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_explicit_route_include_objects(self): + """ + Getter method for explicit_route_include_objects, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects (container) + + YANG Description: Container for the 'include route' object list. + """ + return self.__explicit_route_include_objects + + def _set_explicit_route_include_objects(self, v, load=False): + """ + Setter method for explicit_route_include_objects, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_explicit_route_include_objects is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_explicit_route_include_objects() directly. + + YANG Description: Container for the 'include route' object list. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """explicit_route_include_objects must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__explicit_route_include_objects = t + if hasattr(self, '_set'): + self._set() + + def _unset_explicit_route_include_objects(self): + self.__explicit_route_include_objects = YANGDynClass(base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + metric_type = __builtin__.property(_get_metric_type, _set_metric_type) + weight = __builtin__.property(_get_weight, _set_weight) + explicit_route_exclude_objects = __builtin__.property(_get_explicit_route_exclude_objects, _set_explicit_route_exclude_objects) + explicit_route_include_objects = __builtin__.property(_get_explicit_route_include_objects, _set_explicit_route_include_objects) + + __choices__ = {'algorithm': {'metric': ['metric_type', 'weight', 'explicit_route_exclude_objects', 'explicit_route_include_objects']}} + _pyangbind_elements = OrderedDict([('metric_type', metric_type), ('weight', weight), ('explicit_route_exclude_objects', explicit_route_exclude_objects), ('explicit_route_include_objects', explicit_route_include_objects), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/__init__.py new file mode 100644 index 000000000..f81d927f3 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import route_object_exclude_object +class explicit_route_exclude_objects(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/optimization-metric/explicit-route-exclude-objects. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the 'exclude route' object list. + """ + __slots__ = ('_path_helper', '_extmethods', '__route_object_exclude_object',) + + _yang_name = 'explicit-route-exclude-objects' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__route_object_exclude_object = YANGDynClass(base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects'] + + def _get_route_object_exclude_object(self): + """ + Getter method for route_object_exclude_object, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object (list) + + YANG Description: List of Explicit Route Objects to be excluded in the +path computation. + """ + return self.__route_object_exclude_object + + def _set_route_object_exclude_object(self, v, load=False): + """ + Setter method for route_object_exclude_object, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_route_object_exclude_object is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_route_object_exclude_object() directly. + + YANG Description: List of Explicit Route Objects to be excluded in the +path computation. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """route_object_exclude_object must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__route_object_exclude_object = t + if hasattr(self, '_set'): + self._set() + + def _unset_route_object_exclude_object(self): + self.__route_object_exclude_object = YANGDynClass(base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + route_object_exclude_object = __builtin__.property(_get_route_object_exclude_object, _set_route_object_exclude_object) + + __choices__ = {'algorithm': {'metric': ['route_object_exclude_object']}} + _pyangbind_elements = OrderedDict([('route_object_exclude_object', route_object_exclude_object), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py new file mode 100644 index 000000000..0ce09fde1 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py @@ -0,0 +1,365 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +from . import srlg +class route_object_exclude_object(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of Explicit Route Objects to be excluded in the +path computation. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop','__srlg',) + + _yang_name = 'route-object-exclude-object' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__srlg = YANGDynClass(base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/index (uint32) + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/index (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_srlg(self): + """ + Getter method for srlg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg (container) + + YANG Description: SRLG container. + """ + return self.__srlg + + def _set_srlg(self, v, load=False): + """ + Setter method for srlg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_srlg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_srlg() directly. + + YANG Description: SRLG container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """srlg must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__srlg = t + if hasattr(self, '_set'): + self._set() + + def _unset_srlg(self): + self.__srlg = YANGDynClass(base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + index = __builtin__.property(_get_index, _set_index) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop, _set_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop, _set_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop, _set_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop, _set_as_number_hop) + label_hop = __builtin__.property(_get_label_hop, _set_label_hop) + srlg = __builtin__.property(_get_srlg, _set_srlg) + + __choices__ = {'algorithm': {'metric': ['index']}, 'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop'], 'srlg': ['srlg']}} + _pyangbind_elements = OrderedDict([('index', index), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ('srlg', srlg), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/__init__.py new file mode 100644 index 000000000..0cbff483c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + as_number = __builtin__.property(_get_as_number, _set_as_number) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/__init__.py new file mode 100644 index 000000000..5acd36477 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/__init__.py new file mode 100644 index 000000000..aadad5c2c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/__init__.py new file mode 100644 index 000000000..6c0b396ee --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + tsg = __builtin__.property(_get_tsg, _set_tsg) + ts_list = __builtin__.property(_get_ts_list, _set_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/__init__.py new file mode 100644 index 000000000..bda9afb84 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/__init__.py new file mode 100644 index 000000000..5c7cd97f1 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/__init__.py new file mode 100644 index 000000000..9fdf39249 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/__init__.py @@ -0,0 +1,115 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class srlg(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/srlg. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: SRLG container. + """ + __slots__ = ('_path_helper', '_extmethods', '__srlg',) + + _yang_name = 'srlg' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__srlg = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'srlg'] + + def _get_srlg(self): + """ + Getter method for srlg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/srlg (uint32) + + YANG Description: SRLG value. + """ + return self.__srlg + + def _set_srlg(self, v, load=False): + """ + Setter method for srlg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/srlg (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_srlg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_srlg() directly. + + YANG Description: SRLG value. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """srlg must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__srlg = t + if hasattr(self, '_set'): + self._set() + + def _unset_srlg(self): + self.__srlg = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + srlg = __builtin__.property(_get_srlg, _set_srlg) + + __choices__ = {'type': {'srlg': ['srlg']}} + _pyangbind_elements = OrderedDict([('srlg', srlg), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/__init__.py new file mode 100644 index 000000000..b5794e333 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/__init__.py new file mode 100644 index 000000000..f5e9a3732 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import route_object_include_object +class explicit_route_include_objects(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/optimization-metric/explicit-route-include-objects. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the 'include route' object list. + """ + __slots__ = ('_path_helper', '_extmethods', '__route_object_include_object',) + + _yang_name = 'explicit-route-include-objects' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__route_object_include_object = YANGDynClass(base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'optimization-metric', 'explicit-route-include-objects'] + + def _get_route_object_include_object(self): + """ + Getter method for route_object_include_object, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object (list) + + YANG Description: List of Explicit Route Objects to be included in the +path computation. + """ + return self.__route_object_include_object + + def _set_route_object_include_object(self, v, load=False): + """ + Setter method for route_object_include_object, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_route_object_include_object is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_route_object_include_object() directly. + + YANG Description: List of Explicit Route Objects to be included in the +path computation. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """route_object_include_object must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__route_object_include_object = t + if hasattr(self, '_set'): + self._set() + + def _unset_route_object_include_object(self): + self.__route_object_include_object = YANGDynClass(base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + route_object_include_object = __builtin__.property(_get_route_object_include_object, _set_route_object_include_object) + + __choices__ = {'algorithm': {'metric': ['route_object_include_object']}} + _pyangbind_elements = OrderedDict([('route_object_include_object', route_object_include_object), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py new file mode 100644 index 000000000..374536eb4 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py @@ -0,0 +1,325 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class route_object_include_object(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of Explicit Route Objects to be included in the +path computation. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'route-object-include-object' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/index (uint32) + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/index (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + index = __builtin__.property(_get_index, _set_index) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop, _set_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop, _set_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop, _set_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop, _set_as_number_hop) + label_hop = __builtin__.property(_get_label_hop, _set_label_hop) + + __choices__ = {'algorithm': {'metric': ['index']}, 'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('index', index), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/__init__.py new file mode 100644 index 000000000..0b9ce19d6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + as_number = __builtin__.property(_get_as_number, _set_as_number) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/__init__.py new file mode 100644 index 000000000..b21890c48 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/__init__.py new file mode 100644 index 000000000..df8c13619 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/__init__.py new file mode 100644 index 000000000..7fef4856e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + tsg = __builtin__.property(_get_tsg, _set_tsg) + ts_list = __builtin__.property(_get_ts_list, _set_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/__init__.py new file mode 100644 index 000000000..97b264f0d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/__init__.py new file mode 100644 index 000000000..218283dca --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/__init__.py new file mode 100644 index 000000000..ce387660e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/tiebreakers/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/tiebreakers/__init__.py new file mode 100644 index 000000000..5dbea3946 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/tiebreakers/__init__.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import tiebreaker +class tiebreakers(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/tiebreakers. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of tiebreakers. + """ + __slots__ = ('_path_helper', '_extmethods', '__tiebreaker',) + + _yang_name = 'tiebreakers' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tiebreaker = YANGDynClass(base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'tiebreakers'] + + def _get_tiebreaker(self): + """ + Getter method for tiebreaker, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/tiebreakers/tiebreaker (list) + + YANG Description: The list of tiebreaker criteria to apply on an +equally favored set of paths, in order to pick +the best. + """ + return self.__tiebreaker + + def _set_tiebreaker(self, v, load=False): + """ + Setter method for tiebreaker, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/tiebreakers/tiebreaker (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_tiebreaker is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tiebreaker() directly. + + YANG Description: The list of tiebreaker criteria to apply on an +equally favored set of paths, in order to pick +the best. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tiebreaker must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__tiebreaker = t + if hasattr(self, '_set'): + self._set() + + def _unset_tiebreaker(self): + self.__tiebreaker = YANGDynClass(base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + tiebreaker = __builtin__.property(_get_tiebreaker, _set_tiebreaker) + + __choices__ = {'algorithm': {'metric': ['tiebreaker']}} + _pyangbind_elements = OrderedDict([('tiebreaker', tiebreaker), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/tiebreakers/tiebreaker/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/tiebreakers/tiebreaker/__init__.py new file mode 100644 index 000000000..6c879cb00 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/tiebreakers/tiebreaker/__init__.py @@ -0,0 +1,122 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class tiebreaker(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/optimizations/tiebreakers/tiebreaker. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The list of tiebreaker criteria to apply on an +equally favored set of paths, in order to pick +the best. + """ + __slots__ = ('_path_helper', '_extmethods', '__tiebreaker_type',) + + _yang_name = 'tiebreaker' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tiebreaker_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'optimizations', 'tiebreakers', 'tiebreaker'] + + def _get_tiebreaker_type(self): + """ + Getter method for tiebreaker_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/tiebreakers/tiebreaker/tiebreaker_type (identityref) + + YANG Description: Identifies an entry in the list of tiebreakers. + """ + return self.__tiebreaker_type + + def _set_tiebreaker_type(self, v, load=False): + """ + Setter method for tiebreaker_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/optimizations/tiebreakers/tiebreaker/tiebreaker_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tiebreaker_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tiebreaker_type() directly. + + YANG Description: Identifies an entry in the list of tiebreakers. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tiebreaker_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tiebreaker_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_tiebreaker_type(self): + self.__tiebreaker_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + tiebreaker_type = __builtin__.property(_get_tiebreaker_type, _set_tiebreaker_type) + + __choices__ = {'algorithm': {'metric': ['tiebreaker_type']}} + _pyangbind_elements = OrderedDict([('tiebreaker_type', tiebreaker_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/__init__.py new file mode 100644 index 000000000..f737852bf --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/__init__.py @@ -0,0 +1,523 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_bandwidth +from . import path_metric_bounds +from . import path_affinities_values +from . import path_affinity_names +from . import path_srlgs_lists +from . import path_srlgs_names +class path_constraints(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-constraints. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE named path constraints container. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_bandwidth','__link_protection','__setup_priority','__hold_priority','__signaling_type','__path_metric_bounds','__path_affinities_values','__path_affinity_names','__path_srlgs_lists','__path_srlgs_names','__disjointness',) + + _yang_name = 'path-constraints' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__link_protection = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__setup_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + self.__hold_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + self.__signaling_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__path_metric_bounds = YANGDynClass(base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__disjointness = YANGDynClass(base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-constraints'] + + def _get_te_bandwidth(self): + """ + Getter method for te_bandwidth, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth (container) + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + return self.__te_bandwidth + + def _set_te_bandwidth(self, v, load=False): + """ + Setter method for te_bandwidth, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_bandwidth() directly. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_bandwidth(self): + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_link_protection(self): + """ + Getter method for link_protection, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/link_protection (identityref) + + YANG Description: Link protection type required for the links included +in the computed path. + """ + return self.__link_protection + + def _set_link_protection(self, v, load=False): + """ + Setter method for link_protection, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/link_protection (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_protection is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_protection() directly. + + YANG Description: Link protection type required for the links included +in the computed path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_protection must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__link_protection = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_protection(self): + self.__link_protection = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_setup_priority(self): + """ + Getter method for setup_priority, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/setup_priority (uint8) + + YANG Description: TE LSP requested setup priority. + """ + return self.__setup_priority + + def _set_setup_priority(self, v, load=False): + """ + Setter method for setup_priority, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/setup_priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_setup_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_setup_priority() directly. + + YANG Description: TE LSP requested setup priority. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """setup_priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__setup_priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_setup_priority(self): + self.__setup_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + + + def _get_hold_priority(self): + """ + Getter method for hold_priority, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/hold_priority (uint8) + + YANG Description: TE LSP requested hold priority. + """ + return self.__hold_priority + + def _set_hold_priority(self, v, load=False): + """ + Setter method for hold_priority, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/hold_priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_hold_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hold_priority() directly. + + YANG Description: TE LSP requested hold priority. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hold_priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__hold_priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_hold_priority(self): + self.__hold_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + + + def _get_signaling_type(self): + """ + Getter method for signaling_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/signaling_type (identityref) + + YANG Description: TE tunnel path signaling type. + """ + return self.__signaling_type + + def _set_signaling_type(self, v, load=False): + """ + Setter method for signaling_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/signaling_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_signaling_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_signaling_type() directly. + + YANG Description: TE tunnel path signaling type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """signaling_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__signaling_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_signaling_type(self): + self.__signaling_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_path_metric_bounds(self): + """ + Getter method for path_metric_bounds, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_metric_bounds (container) + + YANG Description: TE path metric bounds container. + """ + return self.__path_metric_bounds + + def _set_path_metric_bounds(self, v, load=False): + """ + Setter method for path_metric_bounds, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_metric_bounds (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_metric_bounds is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_metric_bounds() directly. + + YANG Description: TE path metric bounds container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_metric_bounds must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_metric_bounds = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_metric_bounds(self): + self.__path_metric_bounds = YANGDynClass(base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_affinities_values(self): + """ + Getter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinities_values (container) + + YANG Description: Path affinities represented as values. + """ + return self.__path_affinities_values + + def _set_path_affinities_values(self, v, load=False): + """ + Setter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinities_values (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_values() directly. + + YANG Description: Path affinities represented as values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_values must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_affinities_values = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_values(self): + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_affinity_names(self): + """ + Getter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names (container) + + YANG Description: Path affinities represented as names. + """ + return self.__path_affinity_names + + def _set_path_affinity_names(self, v, load=False): + """ + Setter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_names() directly. + + YANG Description: Path affinities represented as names. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_affinity_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_names(self): + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_srlgs_lists(self): + """ + Getter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_lists (container) + + YANG Description: Path SRLG properties container. + """ + return self.__path_srlgs_lists + + def _set_path_srlgs_lists(self, v, load=False): + """ + Setter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_lists (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_lists is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_lists() directly. + + YANG Description: Path SRLG properties container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_lists must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_srlgs_lists = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_lists(self): + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_srlgs_names(self): + """ + Getter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_names (container) + + YANG Description: Container for the list of named SRLGs. + """ + return self.__path_srlgs_names + + def _set_path_srlgs_names(self, v, load=False): + """ + Setter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_names() directly. + + YANG Description: Container for the list of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_srlgs_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_names(self): + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_disjointness(self): + """ + Getter method for disjointness, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/disjointness (te-path-disjointness) + + YANG Description: The type of resource disjointness. +When configured for a primary path, the disjointness level +applies to all secondary LSPs. When configured for a +secondary path, the disjointness level overrides the level +configured for the primary path. + """ + return self.__disjointness + + def _set_disjointness(self, v, load=False): + """ + Setter method for disjointness, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/disjointness (te-path-disjointness) + If this variable is read-only (config: false) in the + source YANG file, then _set_disjointness is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_disjointness() directly. + + YANG Description: The type of resource disjointness. +When configured for a primary path, the disjointness level +applies to all secondary LSPs. When configured for a +secondary path, the disjointness level overrides the level +configured for the primary path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """disjointness must be of a type compatible with te-path-disjointness""", + 'defined-type': "ietf-te-topology:te-path-disjointness", + 'generated-type': """YANGDynClass(base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', is_config=True)""", + }) + + self.__disjointness = t + if hasattr(self, '_set'): + self._set() + + def _unset_disjointness(self): + self.__disjointness = YANGDynClass(base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', is_config=True) + + te_bandwidth = __builtin__.property(_get_te_bandwidth, _set_te_bandwidth) + link_protection = __builtin__.property(_get_link_protection, _set_link_protection) + setup_priority = __builtin__.property(_get_setup_priority, _set_setup_priority) + hold_priority = __builtin__.property(_get_hold_priority, _set_hold_priority) + signaling_type = __builtin__.property(_get_signaling_type, _set_signaling_type) + path_metric_bounds = __builtin__.property(_get_path_metric_bounds, _set_path_metric_bounds) + path_affinities_values = __builtin__.property(_get_path_affinities_values, _set_path_affinities_values) + path_affinity_names = __builtin__.property(_get_path_affinity_names, _set_path_affinity_names) + path_srlgs_lists = __builtin__.property(_get_path_srlgs_lists, _set_path_srlgs_lists) + path_srlgs_names = __builtin__.property(_get_path_srlgs_names, _set_path_srlgs_names) + disjointness = __builtin__.property(_get_disjointness, _set_disjointness) + + + _pyangbind_elements = OrderedDict([('te_bandwidth', te_bandwidth), ('link_protection', link_protection), ('setup_priority', setup_priority), ('hold_priority', hold_priority), ('signaling_type', signaling_type), ('path_metric_bounds', path_metric_bounds), ('path_affinities_values', path_affinities_values), ('path_affinity_names', path_affinity_names), ('path_srlgs_lists', path_srlgs_lists), ('path_srlgs_names', path_srlgs_names), ('disjointness', disjointness), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinities_values/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinities_values/__init__.py new file mode 100644 index 000000000..9e3265c07 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinities_values/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_affinities_value +class path_affinities_values(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-constraints/path-affinities-values. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as values. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinities_value',) + + _yang_name = 'path-affinities-values' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-constraints', 'path-affinities-values'] + + def _get_path_affinities_value(self): + """ + Getter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinities_values/path_affinities_value (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinities_value + + def _set_path_affinities_value(self, v, load=False): + """ + Setter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinities_values/path_affinities_value (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_value() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_value must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_affinities_value = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_value(self): + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + path_affinities_value = __builtin__.property(_get_path_affinities_value, _set_path_affinities_value) + + + _pyangbind_elements = OrderedDict([('path_affinities_value', path_affinities_value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinities_values/path_affinities_value/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinities_values/path_affinities_value/__init__.py new file mode 100644 index 000000000..8d6c0465d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinities_values/path_affinities_value/__init__.py @@ -0,0 +1,161 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_affinities_value(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-constraints/path-affinities-values/path-affinities-value. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__value',) + + _yang_name = 'path-affinities-value' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-constraints', 'path-affinities-values', 'path-affinities-value'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinities_values/path_affinities_value/usage (identityref) + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinities_values/path_affinities_value/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_value(self): + """ + Getter method for value, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinities_values/path_affinities_value/value (admin-groups) + + YANG Description: The affinity value. The default is empty. + """ + return self.__value + + def _set_value(self, v, load=False): + """ + Setter method for value, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinities_values/path_affinities_value/value (admin-groups) + If this variable is read-only (config: false) in the + source YANG file, then _set_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_value() directly. + + YANG Description: The affinity value. The default is empty. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """value must be of a type compatible with admin-groups""", + 'defined-type': "ietf-te-topology:admin-groups", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=True)""", + }) + + self.__value = t + if hasattr(self, '_set'): + self._set() + + def _unset_value(self): + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=True) + + usage = __builtin__.property(_get_usage, _set_usage) + value = __builtin__.property(_get_value, _set_value) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('value', value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/__init__.py new file mode 100644 index 000000000..93c042152 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_affinity_name +class path_affinity_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-constraints/path-affinity-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as names. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinity_name',) + + _yang_name = 'path-affinity-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-constraints', 'path-affinity-names'] + + def _get_path_affinity_name(self): + """ + Getter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/path_affinity_name (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinity_name + + def _set_path_affinity_name(self, v, load=False): + """ + Setter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/path_affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_name() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_name(self): + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + path_affinity_name = __builtin__.property(_get_path_affinity_name, _set_path_affinity_name) + + + _pyangbind_elements = OrderedDict([('path_affinity_name', path_affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/path_affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/path_affinity_name/__init__.py new file mode 100644 index 000000000..8f1e02095 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/path_affinity_name/__init__.py @@ -0,0 +1,162 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import affinity_name +class path_affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-constraints/path-affinity-names/path-affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__affinity_name',) + + _yang_name = 'path-affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-constraints', 'path-affinity-names', 'path-affinity-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/path_affinity_name/usage (identityref) + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/path_affinity_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_affinity_name(self): + """ + Getter method for affinity_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/path_affinity_name/affinity_name (list) + + YANG Description: List of named affinities. + """ + return self.__affinity_name + + def _set_affinity_name(self, v, load=False): + """ + Setter method for affinity_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/path_affinity_name/affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_affinity_name() directly. + + YANG Description: List of named affinities. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_affinity_name(self): + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + usage = __builtin__.property(_get_usage, _set_usage) + affinity_name = __builtin__.property(_get_affinity_name, _set_affinity_name) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('affinity_name', affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py new file mode 100644 index 000000000..84a532259 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-constraints/path-affinity-names/path-affinity-name/affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinities. + """ + __slots__ = ('_path_helper', '_extmethods', '__name',) + + _yang_name = 'affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-constraints', 'path-affinity-names', 'path-affinity-name', 'affinity-name'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/path_affinity_name/affinity_name/name (string) + + YANG Description: Identifies a named affinity entry. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_affinity_names/path_affinity_name/affinity_name/name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: Identifies a named affinity entry. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + name = __builtin__.property(_get_name, _set_name) + + + _pyangbind_elements = OrderedDict([('name', name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_metric_bounds/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_metric_bounds/__init__.py new file mode 100644 index 000000000..62154c4c0 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_metric_bounds/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_metric_bound +class path_metric_bounds(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-constraints/path-metric-bounds. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE path metric bounds container. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_metric_bound',) + + _yang_name = 'path-metric-bounds' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_metric_bound = YANGDynClass(base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-constraints', 'path-metric-bounds'] + + def _get_path_metric_bound(self): + """ + Getter method for path_metric_bound, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_metric_bounds/path_metric_bound (list) + + YANG Description: List of TE path metric bounds. + """ + return self.__path_metric_bound + + def _set_path_metric_bound(self, v, load=False): + """ + Setter method for path_metric_bound, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_metric_bounds/path_metric_bound (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_metric_bound is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_metric_bound() directly. + + YANG Description: List of TE path metric bounds. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_metric_bound must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_metric_bound = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_metric_bound(self): + self.__path_metric_bound = YANGDynClass(base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + path_metric_bound = __builtin__.property(_get_path_metric_bound, _set_path_metric_bound) + + + _pyangbind_elements = OrderedDict([('path_metric_bound', path_metric_bound), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_metric_bounds/path_metric_bound/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_metric_bounds/path_metric_bound/__init__.py new file mode 100644 index 000000000..61dd53dff --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_metric_bounds/path_metric_bound/__init__.py @@ -0,0 +1,165 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_metric_bound(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-constraints/path-metric-bounds/path-metric-bound. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of TE path metric bounds. + """ + __slots__ = ('_path_helper', '_extmethods', '__metric_type','__upper_bound',) + + _yang_name = 'path-metric-bound' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__upper_bound = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-constraints', 'path-metric-bounds', 'path-metric-bound'] + + def _get_metric_type(self): + """ + Getter method for metric_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_metric_bounds/path_metric_bound/metric_type (identityref) + + YANG Description: Identifies an entry in the list of 'metric-type' items +bound for the TE path. + """ + return self.__metric_type + + def _set_metric_type(self, v, load=False): + """ + Setter method for metric_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_metric_bounds/path_metric_bound/metric_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_metric_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_metric_type() directly. + + YANG Description: Identifies an entry in the list of 'metric-type' items +bound for the TE path. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """metric_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__metric_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_metric_type(self): + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_upper_bound(self): + """ + Getter method for upper_bound, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_metric_bounds/path_metric_bound/upper_bound (uint64) + + YANG Description: Upper bound on the end-to-end TE path metric. A zero +indicates an unbounded upper limit for the specific +'metric-type'. + """ + return self.__upper_bound + + def _set_upper_bound(self, v, load=False): + """ + Setter method for upper_bound, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_metric_bounds/path_metric_bound/upper_bound (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_upper_bound is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_upper_bound() directly. + + YANG Description: Upper bound on the end-to-end TE path metric. A zero +indicates an unbounded upper limit for the specific +'metric-type'. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """upper_bound must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__upper_bound = t + if hasattr(self, '_set'): + self._set() + + def _unset_upper_bound(self): + self.__upper_bound = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=True) + + metric_type = __builtin__.property(_get_metric_type, _set_metric_type) + upper_bound = __builtin__.property(_get_upper_bound, _set_upper_bound) + + + _pyangbind_elements = OrderedDict([('metric_type', metric_type), ('upper_bound', upper_bound), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_lists/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_lists/__init__.py new file mode 100644 index 000000000..28e1d8c74 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_lists/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_srlgs_list +class path_srlgs_lists(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-constraints/path-srlgs-lists. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path SRLG properties container. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_list',) + + _yang_name = 'path-srlgs-lists' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-constraints', 'path-srlgs-lists'] + + def _get_path_srlgs_list(self): + """ + Getter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_lists/path_srlgs_list (list) + + YANG Description: List of SRLG values to be included or excluded. + """ + return self.__path_srlgs_list + + def _set_path_srlgs_list(self, v, load=False): + """ + Setter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_lists/path_srlgs_list (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_list() directly. + + YANG Description: List of SRLG values to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_list must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_srlgs_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_list(self): + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + path_srlgs_list = __builtin__.property(_get_path_srlgs_list, _set_path_srlgs_list) + + + _pyangbind_elements = OrderedDict([('path_srlgs_list', path_srlgs_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py new file mode 100644 index 000000000..a41c502db --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py @@ -0,0 +1,161 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_srlgs_list(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-constraints/path-srlgs-lists/path-srlgs-list. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of SRLG values to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__values',) + + _yang_name = 'path-srlgs-list' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-constraints', 'path-srlgs-lists', 'path-srlgs-list'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_lists/path_srlgs_list/usage (identityref) + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_lists/path_srlgs_list/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_values(self): + """ + Getter method for values, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_lists/path_srlgs_list/values (srlg) + + YANG Description: List of SRLG values. + """ + return self.__values + + def _set_values(self, v, load=False): + """ + Setter method for values, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_lists/path_srlgs_list/values (srlg) + If this variable is read-only (config: false) in the + source YANG file, then _set_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_values() directly. + + YANG Description: List of SRLG values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """values must be of a type compatible with srlg""", + 'defined-type': "ietf-te-topology:srlg", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=True)""", + }) + + self.__values = t + if hasattr(self, '_set'): + self._set() + + def _unset_values(self): + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=True) + + usage = __builtin__.property(_get_usage, _set_usage) + values = __builtin__.property(_get_values, _set_values) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('values', values), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_names/__init__.py new file mode 100644 index 000000000..964651c73 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_names/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_srlgs_name +class path_srlgs_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-constraints/path-srlgs-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of named SRLGs. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_name',) + + _yang_name = 'path-srlgs-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-constraints', 'path-srlgs-names'] + + def _get_path_srlgs_name(self): + """ + Getter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_names/path_srlgs_name (list) + + YANG Description: List of named SRLGs to be included or excluded. + """ + return self.__path_srlgs_name + + def _set_path_srlgs_name(self, v, load=False): + """ + Setter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_names/path_srlgs_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_name() directly. + + YANG Description: List of named SRLGs to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_srlgs_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_name(self): + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + path_srlgs_name = __builtin__.property(_get_path_srlgs_name, _set_path_srlgs_name) + + + _pyangbind_elements = OrderedDict([('path_srlgs_name', path_srlgs_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py new file mode 100644 index 000000000..2ae4647f9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py @@ -0,0 +1,161 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_srlgs_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-constraints/path-srlgs-names/path-srlgs-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named SRLGs to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__names',) + + _yang_name = 'path-srlgs-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-constraints', 'path-srlgs-names', 'path-srlgs-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_names/path_srlgs_name/usage (identityref) + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_names/path_srlgs_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_names(self): + """ + Getter method for names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_names/path_srlgs_name/names (string) + + YANG Description: List of named SRLGs. + """ + return self.__names + + def _set_names(self, v, load=False): + """ + Setter method for names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/path_srlgs_names/path_srlgs_name/names (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_names() directly. + + YANG Description: List of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """names must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True)""", + }) + + self.__names = t + if hasattr(self, '_set'): + self._set() + + def _unset_names(self): + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + usage = __builtin__.property(_get_usage, _set_usage) + names = __builtin__.property(_get_names, _set_names) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('names', names), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/__init__.py new file mode 100644 index 000000000..9d086807a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/__init__.py @@ -0,0 +1,195 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-constraints/te-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_bandwidth',) + + _yang_name = 'te-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-constraints', 'te-bandwidth'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/generic (te-bandwidth) + + YANG Description: Bandwidth specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/generic (te-bandwidth) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Bandwidth specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with te-bandwidth""", + 'defined-type': "ietf-te-topology:te-bandwidth", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/otn (container) + + YANG Description: Bandwidth attributes for OTN links + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Bandwidth attributes for OTN links + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_eth_bandwidth(self): + """ + Getter method for eth_bandwidth, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/eth_bandwidth (uint64) + + YANG Description: Available bandwith value expressed in kilobits per second + """ + return self.__eth_bandwidth + + def _set_eth_bandwidth(self, v, load=False): + """ + Setter method for eth_bandwidth, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/eth_bandwidth (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_bandwidth() directly. + + YANG Description: Available bandwith value expressed in kilobits per second + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_bandwidth must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__eth_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_bandwidth(self): + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + eth_bandwidth = __builtin__.property(_get_eth_bandwidth, _set_eth_bandwidth) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['eth_bandwidth']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_bandwidth', eth_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/otn/__init__.py new file mode 100644 index 000000000..8edd4ebde --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/otn/__init__.py @@ -0,0 +1,163 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import odulist +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-constraints/te-bandwidth/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Bandwidth attributes for OTN links + """ + __slots__ = ('_path_helper', '_extmethods', '__odulist','__odtu_flex_type',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + self.__odtu_flex_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-constraints', 'te-bandwidth', 'otn'] + + def _get_odulist(self): + """ + Getter method for odulist, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/otn/odulist (list) + + YANG Description: OTN bandwidth definition + """ + return self.__odulist + + def _set_odulist(self, v, load=False): + """ + Setter method for odulist, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/otn/odulist (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_odulist is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odulist() directly. + + YANG Description: OTN bandwidth definition + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odulist must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True)""", + }) + + self.__odulist = t + if hasattr(self, '_set'): + self._set() + + def _unset_odulist(self): + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + + + def _get_odtu_flex_type(self): + """ + Getter method for odtu_flex_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/otn/odtu_flex_type (l1-types:odtu-flex-type) + + YANG Description: The type of Optical Data Tributary Unit (ODTU) +whose nominal bitrate is used to compute the number of +Tributary Slots (TS) required by the ODUflex LSPs +set up along the underlay path of this OTN Local +Link Connectivyt entry. + """ + return self.__odtu_flex_type + + def _set_odtu_flex_type(self, v, load=False): + """ + Setter method for odtu_flex_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/otn/odtu_flex_type (l1-types:odtu-flex-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_odtu_flex_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odtu_flex_type() directly. + + YANG Description: The type of Optical Data Tributary Unit (ODTU) +whose nominal bitrate is used to compute the number of +Tributary Slots (TS) required by the ODUflex LSPs +set up along the underlay path of this OTN Local +Link Connectivyt entry. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odtu_flex_type must be of a type compatible with l1-types:odtu-flex-type""", + 'defined-type': "l1-types:odtu-flex-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True)""", + }) + + self.__odtu_flex_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odtu_flex_type(self): + self.__odtu_flex_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True) + + odulist = __builtin__.property(_get_odulist, _set_odulist) + odtu_flex_type = __builtin__.property(_get_odtu_flex_type, _set_odtu_flex_type) + + __choices__ = {'technology': {'otn': ['odulist', 'odtu_flex_type']}} + _pyangbind_elements = OrderedDict([('odulist', odulist), ('odtu_flex_type', odtu_flex_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/otn/odulist/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/otn/odulist/__init__.py new file mode 100644 index 000000000..22a8a8f85 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/otn/odulist/__init__.py @@ -0,0 +1,200 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class odulist(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-constraints/te-bandwidth/otn/odulist. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: OTN bandwidth definition + """ + __slots__ = ('_path_helper', '_extmethods', '__odu_type','__number','__ts_number',) + + _yang_name = 'odulist' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-constraints', 'te-bandwidth', 'otn', 'odulist'] + + def _get_odu_type(self): + """ + Getter method for odu_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/otn/odulist/odu_type (identityref) + + YANG Description: ODU type + """ + return self.__odu_type + + def _set_odu_type(self, v, load=False): + """ + Setter method for odu_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/otn/odulist/odu_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type() directly. + + YANG Description: ODU type + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__odu_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type(self): + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_number(self): + """ + Getter method for number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/otn/odulist/number (uint16) + + YANG Description: Number of ODUs + """ + return self.__number + + def _set_number(self, v, load=False): + """ + Setter method for number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/otn/odulist/number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_number() directly. + + YANG Description: Number of ODUs + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__number = t + if hasattr(self, '_set'): + self._set() + + def _unset_number(self): + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + + def _get_ts_number(self): + """ + Getter method for ts_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/otn/odulist/ts_number (uint16) + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + return self.__ts_number + + def _set_ts_number(self, v, load=False): + """ + Setter method for ts_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_constraints/te_bandwidth/otn/odulist/ts_number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_number() directly. + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__ts_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_number(self): + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + odu_type = __builtin__.property(_get_odu_type, _set_odu_type) + number = __builtin__.property(_get_number, _set_number) + ts_number = __builtin__.property(_get_ts_number, _set_ts_number) + + __choices__ = {'technology': {'otn': ['odu_type', 'number', 'ts_number']}} + _pyangbind_elements = OrderedDict([('odu_type', odu_type), ('number', number), ('ts_number', ts_number), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/__init__.py new file mode 100644 index 000000000..8d881474f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/__init__.py @@ -0,0 +1,318 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_metric +from . import path_affinities_values +from . import path_affinity_names +from . import path_srlgs_lists +from . import path_srlgs_names +from . import path_route_objects +class path_properties(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-properties. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The TE path properties. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_metric','__path_affinities_values','__path_affinity_names','__path_srlgs_lists','__path_srlgs_names','__path_route_objects',) + + _yang_name = 'path-properties' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_metric = YANGDynClass(base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_route_objects = YANGDynClass(base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-properties'] + + def _get_path_metric(self): + """ + Getter method for path_metric, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_metric (list) + + YANG Description: TE path metric type. + """ + return self.__path_metric + + def _set_path_metric(self, v, load=False): + """ + Setter method for path_metric, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_metric (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_metric is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_metric() directly. + + YANG Description: TE path metric type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_metric must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_metric = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_metric(self): + self.__path_metric = YANGDynClass(base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + + def _get_path_affinities_values(self): + """ + Getter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinities_values (container) + + YANG Description: Path affinities represented as values. + """ + return self.__path_affinities_values + + def _set_path_affinities_values(self, v, load=False): + """ + Setter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinities_values (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_values() directly. + + YANG Description: Path affinities represented as values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_values must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_affinities_values = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_values(self): + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_affinity_names(self): + """ + Getter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names (container) + + YANG Description: Path affinities represented as names. + """ + return self.__path_affinity_names + + def _set_path_affinity_names(self, v, load=False): + """ + Setter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_names() directly. + + YANG Description: Path affinities represented as names. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_affinity_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_names(self): + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_srlgs_lists(self): + """ + Getter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_lists (container) + + YANG Description: Path SRLG properties container. + """ + return self.__path_srlgs_lists + + def _set_path_srlgs_lists(self, v, load=False): + """ + Setter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_lists (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_lists is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_lists() directly. + + YANG Description: Path SRLG properties container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_lists must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_srlgs_lists = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_lists(self): + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_srlgs_names(self): + """ + Getter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_names (container) + + YANG Description: Container for the list of named SRLGs. + """ + return self.__path_srlgs_names + + def _set_path_srlgs_names(self, v, load=False): + """ + Setter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_names() directly. + + YANG Description: Container for the list of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_srlgs_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_names(self): + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_route_objects(self): + """ + Getter method for path_route_objects, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects (container) + + YANG Description: Container for the list of route objects either returned by +the computation engine or actually used by an LSP. + """ + return self.__path_route_objects + + def _set_path_route_objects(self, v, load=False): + """ + Setter method for path_route_objects, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_route_objects is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_route_objects() directly. + + YANG Description: Container for the list of route objects either returned by +the computation engine or actually used by an LSP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_route_objects must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_route_objects = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_route_objects(self): + self.__path_route_objects = YANGDynClass(base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + path_metric = __builtin__.property(_get_path_metric) + path_affinities_values = __builtin__.property(_get_path_affinities_values) + path_affinity_names = __builtin__.property(_get_path_affinity_names) + path_srlgs_lists = __builtin__.property(_get_path_srlgs_lists) + path_srlgs_names = __builtin__.property(_get_path_srlgs_names) + path_route_objects = __builtin__.property(_get_path_route_objects) + + + _pyangbind_elements = OrderedDict([('path_metric', path_metric), ('path_affinities_values', path_affinities_values), ('path_affinity_names', path_affinity_names), ('path_srlgs_lists', path_srlgs_lists), ('path_srlgs_names', path_srlgs_names), ('path_route_objects', path_route_objects), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinities_values/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinities_values/__init__.py new file mode 100644 index 000000000..3384b6a42 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinities_values/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_affinities_value +class path_affinities_values(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-properties/path-affinities-values. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as values. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinities_value',) + + _yang_name = 'path-affinities-values' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-properties', 'path-affinities-values'] + + def _get_path_affinities_value(self): + """ + Getter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinities_values/path_affinities_value (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinities_value + + def _set_path_affinities_value(self, v, load=False): + """ + Setter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinities_values/path_affinities_value (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_value() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_value must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_affinities_value = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_value(self): + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_affinities_value = __builtin__.property(_get_path_affinities_value) + + + _pyangbind_elements = OrderedDict([('path_affinities_value', path_affinities_value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinities_values/path_affinities_value/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinities_values/path_affinities_value/__init__.py new file mode 100644 index 000000000..626f7d240 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinities_values/path_affinities_value/__init__.py @@ -0,0 +1,161 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_affinities_value(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-properties/path-affinities-values/path-affinities-value. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__value',) + + _yang_name = 'path-affinities-value' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-properties', 'path-affinities-values', 'path-affinities-value'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinities_values/path_affinities_value/usage (identityref) + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinities_values/path_affinities_value/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_value(self): + """ + Getter method for value, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinities_values/path_affinities_value/value (admin-groups) + + YANG Description: The affinity value. The default is empty. + """ + return self.__value + + def _set_value(self, v, load=False): + """ + Setter method for value, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinities_values/path_affinities_value/value (admin-groups) + If this variable is read-only (config: false) in the + source YANG file, then _set_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_value() directly. + + YANG Description: The affinity value. The default is empty. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """value must be of a type compatible with admin-groups""", + 'defined-type': "ietf-te-topology:admin-groups", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False)""", + }) + + self.__value = t + if hasattr(self, '_set'): + self._set() + + def _unset_value(self): + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False) + + usage = __builtin__.property(_get_usage) + value = __builtin__.property(_get_value) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('value', value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/__init__.py new file mode 100644 index 000000000..3fc26577e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_affinity_name +class path_affinity_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-properties/path-affinity-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as names. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinity_name',) + + _yang_name = 'path-affinity-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-properties', 'path-affinity-names'] + + def _get_path_affinity_name(self): + """ + Getter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/path_affinity_name (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinity_name + + def _set_path_affinity_name(self, v, load=False): + """ + Setter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/path_affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_name() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_name(self): + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_affinity_name = __builtin__.property(_get_path_affinity_name) + + + _pyangbind_elements = OrderedDict([('path_affinity_name', path_affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/path_affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/path_affinity_name/__init__.py new file mode 100644 index 000000000..63035d44d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/path_affinity_name/__init__.py @@ -0,0 +1,162 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import affinity_name +class path_affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-properties/path-affinity-names/path-affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__affinity_name',) + + _yang_name = 'path-affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-properties', 'path-affinity-names', 'path-affinity-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/path_affinity_name/usage (identityref) + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/path_affinity_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_affinity_name(self): + """ + Getter method for affinity_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/path_affinity_name/affinity_name (list) + + YANG Description: List of named affinities. + """ + return self.__affinity_name + + def _set_affinity_name(self, v, load=False): + """ + Setter method for affinity_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/path_affinity_name/affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_affinity_name() directly. + + YANG Description: List of named affinities. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_affinity_name(self): + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + usage = __builtin__.property(_get_usage) + affinity_name = __builtin__.property(_get_affinity_name) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('affinity_name', affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py new file mode 100644 index 000000000..42383ee4d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-properties/path-affinity-names/path-affinity-name/affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinities. + """ + __slots__ = ('_path_helper', '_extmethods', '__name',) + + _yang_name = 'affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-properties', 'path-affinity-names', 'path-affinity-name', 'affinity-name'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/path_affinity_name/affinity_name/name (string) + + YANG Description: Identifies a named affinity entry. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_affinity_names/path_affinity_name/affinity_name/name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: Identifies a named affinity entry. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + name = __builtin__.property(_get_name) + + + _pyangbind_elements = OrderedDict([('name', name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_metric/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_metric/__init__.py new file mode 100644 index 000000000..5a283282d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_metric/__init__.py @@ -0,0 +1,159 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_metric(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-properties/path-metric. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE path metric type. + """ + __slots__ = ('_path_helper', '_extmethods', '__metric_type','__accumulative_value',) + + _yang_name = 'path-metric' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__accumulative_value = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-properties', 'path-metric'] + + def _get_metric_type(self): + """ + Getter method for metric_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_metric/metric_type (identityref) + + YANG Description: TE path metric type. + """ + return self.__metric_type + + def _set_metric_type(self, v, load=False): + """ + Setter method for metric_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_metric/metric_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_metric_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_metric_type() directly. + + YANG Description: TE path metric type. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """metric_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__metric_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_metric_type(self): + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_accumulative_value(self): + """ + Getter method for accumulative_value, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_metric/accumulative_value (uint64) + + YANG Description: TE path metric accumulative value. + """ + return self.__accumulative_value + + def _set_accumulative_value(self, v, load=False): + """ + Setter method for accumulative_value, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_metric/accumulative_value (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_accumulative_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_accumulative_value() directly. + + YANG Description: TE path metric accumulative value. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """accumulative_value must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False)""", + }) + + self.__accumulative_value = t + if hasattr(self, '_set'): + self._set() + + def _unset_accumulative_value(self): + self.__accumulative_value = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + + metric_type = __builtin__.property(_get_metric_type) + accumulative_value = __builtin__.property(_get_accumulative_value) + + + _pyangbind_elements = OrderedDict([('metric_type', metric_type), ('accumulative_value', accumulative_value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/__init__.py new file mode 100644 index 000000000..425ac19d0 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/__init__.py @@ -0,0 +1,119 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_route_object +class path_route_objects(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-properties/path-route-objects. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of route objects either returned by +the computation engine or actually used by an LSP. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_route_object',) + + _yang_name = 'path-route-objects' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_route_object = YANGDynClass(base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-properties', 'path-route-objects'] + + def _get_path_route_object(self): + """ + Getter method for path_route_object, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object (list) + + YANG Description: List of route objects either returned by the computation +engine or actually used by an LSP. + """ + return self.__path_route_object + + def _set_path_route_object(self, v, load=False): + """ + Setter method for path_route_object, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_route_object is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_route_object() directly. + + YANG Description: List of route objects either returned by the computation +engine or actually used by an LSP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_route_object must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_route_object = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_route_object(self): + self.__path_route_object = YANGDynClass(base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_route_object = __builtin__.property(_get_path_route_object) + + + _pyangbind_elements = OrderedDict([('path_route_object', path_route_object), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/__init__.py new file mode 100644 index 000000000..abb7aee29 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/__init__.py @@ -0,0 +1,327 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class path_route_object(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-properties/path-route-objects/path-route-object. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of route objects either returned by the computation +engine or actually used by an LSP. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'path-route-object' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-properties', 'path-route-objects', 'path-route-object'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/index (uint32) + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key +values. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/index (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key +values. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + index = __builtin__.property(_get_index) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop) + label_hop = __builtin__.property(_get_label_hop) + + __choices__ = {'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('index', index), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/as_number_hop/__init__.py new file mode 100644 index 000000000..b3d293b83 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-properties/path-route-objects/path-route-object/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-properties', 'path-route-objects', 'path-route-object', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + as_number = __builtin__.property(_get_as_number) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/__init__.py new file mode 100644 index 000000000..10f4a55b7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-properties/path-route-objects/path-route-object/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-properties', 'path-route-objects', 'path-route-object', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_label = __builtin__.property(_get_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label/__init__.py new file mode 100644 index 000000000..8764e4794 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-properties/path-route-objects/path-route-object/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-properties', 'path-route-objects', 'path-route-object', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + vlanid = __builtin__.property(_get_vlanid) + direction = __builtin__.property(_get_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/__init__.py new file mode 100644 index 000000000..25a5ec822 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-properties/path-route-objects/path-route-object/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-properties', 'path-route-objects', 'path-route-object', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + + tpn = __builtin__.property(_get_tpn) + tsg = __builtin__.property(_get_tsg) + ts_list = __builtin__.property(_get_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/numbered_link_hop/__init__.py new file mode 100644 index 000000000..7f9882c11 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-properties/path-route-objects/path-route-object/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-properties', 'path-route-objects', 'path-route-object', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/numbered_node_hop/__init__.py new file mode 100644 index 000000000..c406a2f54 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-properties/path-route-objects/path-route-object/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-properties', 'path-route-objects', 'path-route-object', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/numbered_node_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/__init__.py new file mode 100644 index 000000000..c965f3ce1 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-properties/path-route-objects/path-route-object/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-properties', 'path-route-objects', 'path-route-object', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_lists/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_lists/__init__.py new file mode 100644 index 000000000..db6b557eb --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_lists/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_srlgs_list +class path_srlgs_lists(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-properties/path-srlgs-lists. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path SRLG properties container. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_list',) + + _yang_name = 'path-srlgs-lists' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-properties', 'path-srlgs-lists'] + + def _get_path_srlgs_list(self): + """ + Getter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_lists/path_srlgs_list (list) + + YANG Description: List of SRLG values to be included or excluded. + """ + return self.__path_srlgs_list + + def _set_path_srlgs_list(self, v, load=False): + """ + Setter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_lists/path_srlgs_list (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_list() directly. + + YANG Description: List of SRLG values to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_list must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_srlgs_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_list(self): + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_srlgs_list = __builtin__.property(_get_path_srlgs_list) + + + _pyangbind_elements = OrderedDict([('path_srlgs_list', path_srlgs_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py new file mode 100644 index 000000000..909764a6d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py @@ -0,0 +1,161 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_srlgs_list(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-properties/path-srlgs-lists/path-srlgs-list. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of SRLG values to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__values',) + + _yang_name = 'path-srlgs-list' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-properties', 'path-srlgs-lists', 'path-srlgs-list'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_lists/path_srlgs_list/usage (identityref) + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_lists/path_srlgs_list/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_values(self): + """ + Getter method for values, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_lists/path_srlgs_list/values (srlg) + + YANG Description: List of SRLG values. + """ + return self.__values + + def _set_values(self, v, load=False): + """ + Setter method for values, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_lists/path_srlgs_list/values (srlg) + If this variable is read-only (config: false) in the + source YANG file, then _set_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_values() directly. + + YANG Description: List of SRLG values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """values must be of a type compatible with srlg""", + 'defined-type': "ietf-te-topology:srlg", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False)""", + }) + + self.__values = t + if hasattr(self, '_set'): + self._set() + + def _unset_values(self): + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False) + + usage = __builtin__.property(_get_usage) + values = __builtin__.property(_get_values) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('values', values), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_names/__init__.py new file mode 100644 index 000000000..7466c4918 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_names/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_srlgs_name +class path_srlgs_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-properties/path-srlgs-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of named SRLGs. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_name',) + + _yang_name = 'path-srlgs-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-properties', 'path-srlgs-names'] + + def _get_path_srlgs_name(self): + """ + Getter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_names/path_srlgs_name (list) + + YANG Description: List of named SRLGs to be included or excluded. + """ + return self.__path_srlgs_name + + def _set_path_srlgs_name(self, v, load=False): + """ + Setter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_names/path_srlgs_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_name() directly. + + YANG Description: List of named SRLGs to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_srlgs_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_name(self): + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_srlgs_name = __builtin__.property(_get_path_srlgs_name) + + + _pyangbind_elements = OrderedDict([('path_srlgs_name', path_srlgs_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_names/path_srlgs_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_names/path_srlgs_name/__init__.py new file mode 100644 index 000000000..75f5ea586 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_names/path_srlgs_name/__init__.py @@ -0,0 +1,161 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_srlgs_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/path-properties/path-srlgs-names/path-srlgs-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named SRLGs to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__names',) + + _yang_name = 'path-srlgs-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'path-properties', 'path-srlgs-names', 'path-srlgs-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_names/path_srlgs_name/usage (identityref) + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_names/path_srlgs_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_names(self): + """ + Getter method for names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_names/path_srlgs_name/names (string) + + YANG Description: List of named SRLGs. + """ + return self.__names + + def _set_names(self, v, load=False): + """ + Setter method for names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/path_properties/path_srlgs_names/path_srlgs_name/names (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_names() directly. + + YANG Description: List of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """names must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__names = t + if hasattr(self, '_set'): + self._set() + + def _unset_names(self): + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + usage = __builtin__.property(_get_usage) + names = __builtin__.property(_get_names) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('names', names), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/__init__.py new file mode 100644 index 000000000..e4c8bb6d3 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/__init__.py @@ -0,0 +1,326 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import primary_path +from . import backup_path +from . import tunnel_termination_points +from . import tunnels +class underlay(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/underlay. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Attributes of the TE link underlay. + """ + __slots__ = ('_path_helper', '_extmethods', '__enabled','__primary_path','__backup_path','__protection_type','__tunnel_termination_points','__tunnels',) + + _yang_name = 'underlay' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__enabled = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + self.__primary_path = YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__backup_path = YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + self.__protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__tunnel_termination_points = YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__tunnels = YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'underlay'] + + def _get_enabled(self): + """ + Getter method for enabled, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/enabled (boolean) + + YANG Description: 'true' if the underlay is enabled. +'false' if the underlay is disabled. + """ + return self.__enabled + + def _set_enabled(self, v, load=False): + """ + Setter method for enabled, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/enabled (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_enabled is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_enabled() directly. + + YANG Description: 'true' if the underlay is enabled. +'false' if the underlay is disabled. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """enabled must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__enabled = t + if hasattr(self, '_set'): + self._set() + + def _unset_enabled(self): + self.__enabled = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + + def _get_primary_path(self): + """ + Getter method for primary_path, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path (container) + + YANG Description: The service path on the underlay topology that +supports this link. + """ + return self.__primary_path + + def _set_primary_path(self, v, load=False): + """ + Setter method for primary_path, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_primary_path is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_primary_path() directly. + + YANG Description: The service path on the underlay topology that +supports this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """primary_path must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__primary_path = t + if hasattr(self, '_set'): + self._set() + + def _unset_primary_path(self): + self.__primary_path = YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_backup_path(self): + """ + Getter method for backup_path, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path (list) + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + return self.__backup_path + + def _set_backup_path(self, v, load=False): + """ + Setter method for backup_path, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_backup_path is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_backup_path() directly. + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """backup_path must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__backup_path = t + if hasattr(self, '_set'): + self._set() + + def _unset_backup_path(self): + self.__backup_path = YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + + def _get_protection_type(self): + """ + Getter method for protection_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/protection_type (identityref) + + YANG Description: Underlay protection type desired for this link. + """ + return self.__protection_type + + def _set_protection_type(self, v, load=False): + """ + Setter method for protection_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/protection_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_protection_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_protection_type() directly. + + YANG Description: Underlay protection type desired for this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """protection_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__protection_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_protection_type(self): + self.__protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_tunnel_termination_points(self): + """ + Getter method for tunnel_termination_points, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnel_termination_points (container) + + YANG Description: Underlay TTPs desired for this link. + """ + return self.__tunnel_termination_points + + def _set_tunnel_termination_points(self, v, load=False): + """ + Setter method for tunnel_termination_points, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnel_termination_points (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel_termination_points is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel_termination_points() directly. + + YANG Description: Underlay TTPs desired for this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel_termination_points must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__tunnel_termination_points = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel_termination_points(self): + self.__tunnel_termination_points = YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_tunnels(self): + """ + Getter method for tunnels, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnels (container) + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + return self.__tunnels + + def _set_tunnels(self, v, load=False): + """ + Setter method for tunnels, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnels (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnels is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnels() directly. + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnels must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__tunnels = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnels(self): + self.__tunnels = YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + enabled = __builtin__.property(_get_enabled, _set_enabled) + primary_path = __builtin__.property(_get_primary_path, _set_primary_path) + backup_path = __builtin__.property(_get_backup_path, _set_backup_path) + protection_type = __builtin__.property(_get_protection_type, _set_protection_type) + tunnel_termination_points = __builtin__.property(_get_tunnel_termination_points, _set_tunnel_termination_points) + tunnels = __builtin__.property(_get_tunnels, _set_tunnels) + + + _pyangbind_elements = OrderedDict([('enabled', enabled), ('primary_path', primary_path), ('backup_path', backup_path), ('protection_type', protection_type), ('tunnel_termination_points', tunnel_termination_points), ('tunnels', tunnels), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/__init__.py new file mode 100644 index 000000000..f9690f938 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/__init__.py @@ -0,0 +1,207 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_element +class backup_path(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/underlay/backup-path. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__network_ref','__path_element',) + + _yang_name = 'backup-path' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'underlay', 'backup-path'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/index (uint32) + + YANG Description: A sequence number to identify a backup path. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/index (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: A sequence number to identify a backup path. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + + def _get_path_element(self): + """ + Getter method for path_element, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element (list) + + YANG Description: A list of path elements describing the backup service +path. + """ + return self.__path_element + + def _set_path_element(self, v, load=False): + """ + Setter method for path_element, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element() directly. + + YANG Description: A list of path elements describing the backup service +path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_element = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element(self): + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + index = __builtin__.property(_get_index, _set_index) + network_ref = __builtin__.property(_get_network_ref, _set_network_ref) + path_element = __builtin__.property(_get_path_element, _set_path_element) + + + _pyangbind_elements = OrderedDict([('index', index), ('network_ref', network_ref), ('path_element', path_element), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/__init__.py new file mode 100644 index 000000000..beb298aa1 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/__init__.py @@ -0,0 +1,321 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class path_element(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/underlay/backup-path/path-element. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of path elements describing the backup service +path. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_element_id','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'path-element' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'underlay', 'backup-path', 'path-element'] + + def _get_path_element_id(self): + """ + Getter method for path_element_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/path_element_id (uint32) + + YANG Description: To identify the element in a path. + """ + return self.__path_element_id + + def _set_path_element_id(self, v, load=False): + """ + Setter method for path_element_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/path_element_id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element_id() directly. + + YANG Description: To identify the element in a path. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element_id must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__path_element_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element_id(self): + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + path_element_id = __builtin__.property(_get_path_element_id, _set_path_element_id) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop, _set_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop, _set_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop, _set_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop, _set_as_number_hop) + label_hop = __builtin__.property(_get_label_hop, _set_label_hop) + + __choices__ = {'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('path_element_id', path_element_id), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/as_number_hop/__init__.py new file mode 100644 index 000000000..60abe510b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/underlay/backup-path/path-element/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'underlay', 'backup-path', 'path-element', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + as_number = __builtin__.property(_get_as_number, _set_as_number) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/__init__.py new file mode 100644 index 000000000..5ee2330a9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/underlay/backup-path/path-element/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'underlay', 'backup-path', 'path-element', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label/__init__.py new file mode 100644 index 000000000..94d9603a0 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/underlay/backup-path/path-element/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'underlay', 'backup-path', 'path-element', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py new file mode 100644 index 000000000..3dfbe742a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/underlay/backup-path/path-element/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'underlay', 'backup-path', 'path-element', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + tsg = __builtin__.property(_get_tsg, _set_tsg) + ts_list = __builtin__.property(_get_ts_list, _set_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/numbered_link_hop/__init__.py new file mode 100644 index 000000000..d9b3a906d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/underlay/backup-path/path-element/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'underlay', 'backup-path', 'path-element', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/numbered_node_hop/__init__.py new file mode 100644 index 000000000..e4e408039 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/underlay/backup-path/path-element/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'underlay', 'backup-path', 'path-element', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/numbered_node_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py new file mode 100644 index 000000000..274e9473a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/underlay/backup-path/path-element/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'underlay', 'backup-path', 'path-element', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/unnumbered_link_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/backup_path/path_element/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/__init__.py new file mode 100644 index 000000000..56854b585 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/__init__.py @@ -0,0 +1,158 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_element +class primary_path(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/underlay/primary-path. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The service path on the underlay topology that +supports this link. + """ + __slots__ = ('_path_helper', '_extmethods', '__network_ref','__path_element',) + + _yang_name = 'primary-path' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'underlay', 'primary-path'] + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + + def _get_path_element(self): + """ + Getter method for path_element, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element (list) + + YANG Description: A list of path elements describing the service path. + """ + return self.__path_element + + def _set_path_element(self, v, load=False): + """ + Setter method for path_element, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element() directly. + + YANG Description: A list of path elements describing the service path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_element = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element(self): + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + network_ref = __builtin__.property(_get_network_ref, _set_network_ref) + path_element = __builtin__.property(_get_path_element, _set_path_element) + + + _pyangbind_elements = OrderedDict([('network_ref', network_ref), ('path_element', path_element), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/__init__.py new file mode 100644 index 000000000..f54312b46 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/__init__.py @@ -0,0 +1,320 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class path_element(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/underlay/primary-path/path-element. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of path elements describing the service path. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_element_id','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'path-element' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'underlay', 'primary-path', 'path-element'] + + def _get_path_element_id(self): + """ + Getter method for path_element_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/path_element_id (uint32) + + YANG Description: To identify the element in a path. + """ + return self.__path_element_id + + def _set_path_element_id(self, v, load=False): + """ + Setter method for path_element_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/path_element_id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element_id() directly. + + YANG Description: To identify the element in a path. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element_id must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__path_element_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element_id(self): + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + path_element_id = __builtin__.property(_get_path_element_id, _set_path_element_id) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop, _set_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop, _set_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop, _set_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop, _set_as_number_hop) + label_hop = __builtin__.property(_get_label_hop, _set_label_hop) + + __choices__ = {'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('path_element_id', path_element_id), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/as_number_hop/__init__.py new file mode 100644 index 000000000..013370a26 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/underlay/primary-path/path-element/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'underlay', 'primary-path', 'path-element', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + as_number = __builtin__.property(_get_as_number, _set_as_number) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/__init__.py new file mode 100644 index 000000000..1f048ca63 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/underlay/primary-path/path-element/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'underlay', 'primary-path', 'path-element', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label/__init__.py new file mode 100644 index 000000000..345fd6279 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/underlay/primary-path/path-element/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'underlay', 'primary-path', 'path-element', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py new file mode 100644 index 000000000..453fa0717 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/underlay/primary-path/path-element/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'underlay', 'primary-path', 'path-element', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + tsg = __builtin__.property(_get_tsg, _set_tsg) + ts_list = __builtin__.property(_get_ts_list, _set_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/numbered_link_hop/__init__.py new file mode 100644 index 000000000..1e222d434 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/underlay/primary-path/path-element/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'underlay', 'primary-path', 'path-element', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/numbered_node_hop/__init__.py new file mode 100644 index 000000000..fdc5c1728 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/underlay/primary-path/path-element/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'underlay', 'primary-path', 'path-element', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/numbered_node_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py new file mode 100644 index 000000000..1f41ade4f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/underlay/primary-path/path-element/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'underlay', 'primary-path', 'path-element', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/unnumbered_link_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/primary_path/path_element/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnel_termination_points/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnel_termination_points/__init__.py new file mode 100644 index 000000000..f0ae851c1 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnel_termination_points/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class tunnel_termination_points(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/underlay/tunnel-termination-points. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Underlay TTPs desired for this link. + """ + __slots__ = ('_path_helper', '_extmethods', '__source','__destination',) + + _yang_name = 'tunnel-termination-points' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__source = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + self.__destination = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'underlay', 'tunnel-termination-points'] + + def _get_source(self): + """ + Getter method for source, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnel_termination_points/source (binary) + + YANG Description: Source TTP identifier. + """ + return self.__source + + def _set_source(self, v, load=False): + """ + Setter method for source, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnel_termination_points/source (binary) + If this variable is read-only (config: false) in the + source YANG file, then _set_source is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_source() directly. + + YANG Description: Source TTP identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """source must be of a type compatible with binary""", + 'defined-type': "binary", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True)""", + }) + + self.__source = t + if hasattr(self, '_set'): + self._set() + + def _unset_source(self): + self.__source = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + + + def _get_destination(self): + """ + Getter method for destination, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnel_termination_points/destination (binary) + + YANG Description: Destination TTP identifier. + """ + return self.__destination + + def _set_destination(self, v, load=False): + """ + Setter method for destination, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnel_termination_points/destination (binary) + If this variable is read-only (config: false) in the + source YANG file, then _set_destination is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_destination() directly. + + YANG Description: Destination TTP identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """destination must be of a type compatible with binary""", + 'defined-type': "binary", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True)""", + }) + + self.__destination = t + if hasattr(self, '_set'): + self._set() + + def _unset_destination(self): + self.__destination = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + + source = __builtin__.property(_get_source, _set_source) + destination = __builtin__.property(_get_destination, _set_destination) + + + _pyangbind_elements = OrderedDict([('source', source), ('destination', destination), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnels/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnels/__init__.py new file mode 100644 index 000000000..b49e97083 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnels/__init__.py @@ -0,0 +1,167 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import tunnel +class tunnels(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/underlay/tunnels. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + __slots__ = ('_path_helper', '_extmethods', '__sharing','__tunnel',) + + _yang_name = 'tunnels' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__sharing = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + self.__tunnel = YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'underlay', 'tunnels'] + + def _get_sharing(self): + """ + Getter method for sharing, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnels/sharing (boolean) + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. +This leaf is the default option for all TE tunnels +and may be overridden by the per-TE-tunnel value. + """ + return self.__sharing + + def _set_sharing(self, v, load=False): + """ + Setter method for sharing, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnels/sharing (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_sharing is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_sharing() directly. + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. +This leaf is the default option for all TE tunnels +and may be overridden by the per-TE-tunnel value. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """sharing must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__sharing = t + if hasattr(self, '_set'): + self._set() + + def _unset_sharing(self): + self.__sharing = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + + def _get_tunnel(self): + """ + Getter method for tunnel, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnels/tunnel (list) + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + return self.__tunnel + + def _set_tunnel(self, v, load=False): + """ + Setter method for tunnel, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnels/tunnel (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel() directly. + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__tunnel = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel(self): + self.__tunnel = YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + sharing = __builtin__.property(_get_sharing, _set_sharing) + tunnel = __builtin__.property(_get_tunnel, _set_tunnel) + + + _pyangbind_elements = OrderedDict([('sharing', sharing), ('tunnel', tunnel), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnels/tunnel/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnels/tunnel/__init__.py new file mode 100644 index 000000000..bc8bc8ecb --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnels/tunnel/__init__.py @@ -0,0 +1,170 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class tunnel(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/local-link-connectivity/underlay/tunnels/tunnel. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + __slots__ = ('_path_helper', '_extmethods', '__tunnel_name','__sharing',) + + _yang_name = 'tunnel' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tunnel_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + self.__sharing = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'local-link-connectivity', 'underlay', 'tunnels', 'tunnel'] + + def _get_tunnel_name(self): + """ + Getter method for tunnel_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnels/tunnel/tunnel_name (string) + + YANG Description: A tunnel name uniquely identifies an underlay TE tunnel, +used together with the 'source-node' value for this +link. + """ + return self.__tunnel_name + + def _set_tunnel_name(self, v, load=False): + """ + Setter method for tunnel_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnels/tunnel/tunnel_name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel_name() directly. + + YANG Description: A tunnel name uniquely identifies an underlay TE tunnel, +used together with the 'source-node' value for this +link. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel_name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True)""", + }) + + self.__tunnel_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel_name(self): + self.__tunnel_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + + def _get_sharing(self): + """ + Getter method for sharing, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnels/tunnel/sharing (boolean) + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. + """ + return self.__sharing + + def _set_sharing(self, v, load=False): + """ + Setter method for sharing, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/local_link_connectivity/underlay/tunnels/tunnel/sharing (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_sharing is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_sharing() directly. + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """sharing must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__sharing = t + if hasattr(self, '_set'): + self._set() + + def _unset_sharing(self): + self.__sharing = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + tunnel_name = __builtin__.property(_get_tunnel_name, _set_tunnel_name) + sharing = __builtin__.property(_get_sharing, _set_sharing) + + + _pyangbind_elements = OrderedDict([('tunnel_name', tunnel_name), ('sharing', sharing), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/__init__.py new file mode 100644 index 000000000..5ed824918 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/__init__.py @@ -0,0 +1,199 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import optimization_metric +from . import tiebreakers +from . import objective_function +class optimizations(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + __slots__ = ('_path_helper', '_extmethods', '__optimization_metric','__tiebreakers','__objective_function',) + + _yang_name = 'optimizations' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__optimization_metric = YANGDynClass(base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + self.__tiebreakers = YANGDynClass(base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__objective_function = YANGDynClass(base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations'] + + def _get_optimization_metric(self): + """ + Getter method for optimization_metric, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric (list) + + YANG Description: TE path metric type. + """ + return self.__optimization_metric + + def _set_optimization_metric(self, v, load=False): + """ + Setter method for optimization_metric, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_optimization_metric is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_optimization_metric() directly. + + YANG Description: TE path metric type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """optimization_metric must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__optimization_metric = t + if hasattr(self, '_set'): + self._set() + + def _unset_optimization_metric(self): + self.__optimization_metric = YANGDynClass(base=YANGListType("metric_type",optimization_metric.optimization_metric, yang_name="optimization-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None, choice=False), is_container='list', yang_name="optimization-metric", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + + def _get_tiebreakers(self): + """ + Getter method for tiebreakers, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/tiebreakers (container) + + YANG Description: Container for the list of tiebreakers. + """ + return self.__tiebreakers + + def _set_tiebreakers(self, v, load=False): + """ + Setter method for tiebreakers, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/tiebreakers (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tiebreakers is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tiebreakers() directly. + + YANG Description: Container for the list of tiebreakers. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tiebreakers must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__tiebreakers = t + if hasattr(self, '_set'): + self._set() + + def _unset_tiebreakers(self): + self.__tiebreakers = YANGDynClass(base=tiebreakers.tiebreakers, is_container='container', yang_name="tiebreakers", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_objective_function(self): + """ + Getter method for objective_function, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/objective_function (container) + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + return self.__objective_function + + def _set_objective_function(self, v, load=False): + """ + Setter method for objective_function, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/objective_function (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_objective_function is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_objective_function() directly. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """objective_function must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__objective_function = t + if hasattr(self, '_set'): + self._set() + + def _unset_objective_function(self): + self.__objective_function = YANGDynClass(base=objective_function.objective_function, is_container='container', yang_name="objective-function", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + optimization_metric = __builtin__.property(_get_optimization_metric, _set_optimization_metric) + tiebreakers = __builtin__.property(_get_tiebreakers, _set_tiebreakers) + objective_function = __builtin__.property(_get_objective_function, _set_objective_function) + + __choices__ = {'algorithm': {'metric': ['optimization_metric', 'tiebreakers'], 'objective-function': ['objective_function']}} + _pyangbind_elements = OrderedDict([('optimization_metric', optimization_metric), ('tiebreakers', tiebreakers), ('objective_function', objective_function), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/objective_function/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/objective_function/__init__.py new file mode 100644 index 000000000..3c10569db --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/objective_function/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class objective_function(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/objective-function. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The objective function container that includes +attributes to impose when computing a TE path. + """ + __slots__ = ('_path_helper', '_extmethods', '__objective_function_type',) + + _yang_name = 'objective-function' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__objective_function_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'objective-function'] + + def _get_objective_function_type(self): + """ + Getter method for objective_function_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/objective_function/objective_function_type (identityref) + + YANG Description: Objective function entry. + """ + return self.__objective_function_type + + def _set_objective_function_type(self, v, load=False): + """ + Setter method for objective_function_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/objective_function/objective_function_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_objective_function_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_objective_function_type() directly. + + YANG Description: Objective function entry. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """objective_function_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__objective_function_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_objective_function_type(self): + self.__objective_function_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:of-minimize-cost-path"), is_leaf=True, yang_name="objective-function-type", parent=self, choice=('algorithm', 'objective-function'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + objective_function_type = __builtin__.property(_get_objective_function_type, _set_objective_function_type) + + __choices__ = {'algorithm': {'objective-function': ['objective_function_type']}} + _pyangbind_elements = OrderedDict([('objective_function_type', objective_function_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/__init__.py new file mode 100644 index 000000000..abb419890 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/__init__.py @@ -0,0 +1,241 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import explicit_route_exclude_objects +from . import explicit_route_include_objects +class optimization_metric(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/optimization-metric. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE path metric type. + """ + __slots__ = ('_path_helper', '_extmethods', '__metric_type','__weight','__explicit_route_exclude_objects','__explicit_route_include_objects',) + + _yang_name = 'optimization-metric' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__weight = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + self.__explicit_route_exclude_objects = YANGDynClass(base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__explicit_route_include_objects = YANGDynClass(base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'optimization-metric'] + + def _get_metric_type(self): + """ + Getter method for metric_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/metric_type (identityref) + + YANG Description: Identifies the 'metric-type' that the path computation +process uses for optimization. + """ + return self.__metric_type + + def _set_metric_type(self, v, load=False): + """ + Setter method for metric_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/metric_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_metric_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_metric_type() directly. + + YANG Description: Identifies the 'metric-type' that the path computation +process uses for optimization. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """metric_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__metric_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_metric_type(self): + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_weight(self): + """ + Getter method for weight, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/weight (uint8) + + YANG Description: TE path metric normalization weight. + """ + return self.__weight + + def _set_weight(self, v, load=False): + """ + Setter method for weight, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/weight (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_weight is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_weight() directly. + + YANG Description: TE path metric normalization weight. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """weight must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__weight = t + if hasattr(self, '_set'): + self._set() + + def _unset_weight(self): + self.__weight = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(1), is_leaf=True, yang_name="weight", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + + + def _get_explicit_route_exclude_objects(self): + """ + Getter method for explicit_route_exclude_objects, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects (container) + + YANG Description: Container for the 'exclude route' object list. + """ + return self.__explicit_route_exclude_objects + + def _set_explicit_route_exclude_objects(self, v, load=False): + """ + Setter method for explicit_route_exclude_objects, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_explicit_route_exclude_objects is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_explicit_route_exclude_objects() directly. + + YANG Description: Container for the 'exclude route' object list. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """explicit_route_exclude_objects must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__explicit_route_exclude_objects = t + if hasattr(self, '_set'): + self._set() + + def _unset_explicit_route_exclude_objects(self): + self.__explicit_route_exclude_objects = YANGDynClass(base=explicit_route_exclude_objects.explicit_route_exclude_objects, is_container='container', yang_name="explicit-route-exclude-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_explicit_route_include_objects(self): + """ + Getter method for explicit_route_include_objects, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects (container) + + YANG Description: Container for the 'include route' object list. + """ + return self.__explicit_route_include_objects + + def _set_explicit_route_include_objects(self, v, load=False): + """ + Setter method for explicit_route_include_objects, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_explicit_route_include_objects is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_explicit_route_include_objects() directly. + + YANG Description: Container for the 'include route' object list. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """explicit_route_include_objects must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__explicit_route_include_objects = t + if hasattr(self, '_set'): + self._set() + + def _unset_explicit_route_include_objects(self): + self.__explicit_route_include_objects = YANGDynClass(base=explicit_route_include_objects.explicit_route_include_objects, is_container='container', yang_name="explicit-route-include-objects", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + metric_type = __builtin__.property(_get_metric_type, _set_metric_type) + weight = __builtin__.property(_get_weight, _set_weight) + explicit_route_exclude_objects = __builtin__.property(_get_explicit_route_exclude_objects, _set_explicit_route_exclude_objects) + explicit_route_include_objects = __builtin__.property(_get_explicit_route_include_objects, _set_explicit_route_include_objects) + + __choices__ = {'algorithm': {'metric': ['metric_type', 'weight', 'explicit_route_exclude_objects', 'explicit_route_include_objects']}} + _pyangbind_elements = OrderedDict([('metric_type', metric_type), ('weight', weight), ('explicit_route_exclude_objects', explicit_route_exclude_objects), ('explicit_route_include_objects', explicit_route_include_objects), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/__init__.py new file mode 100644 index 000000000..3831dbff9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import route_object_exclude_object +class explicit_route_exclude_objects(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/optimization-metric/explicit-route-exclude-objects. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the 'exclude route' object list. + """ + __slots__ = ('_path_helper', '_extmethods', '__route_object_exclude_object',) + + _yang_name = 'explicit-route-exclude-objects' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__route_object_exclude_object = YANGDynClass(base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects'] + + def _get_route_object_exclude_object(self): + """ + Getter method for route_object_exclude_object, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object (list) + + YANG Description: List of Explicit Route Objects to be excluded in the +path computation. + """ + return self.__route_object_exclude_object + + def _set_route_object_exclude_object(self, v, load=False): + """ + Setter method for route_object_exclude_object, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_route_object_exclude_object is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_route_object_exclude_object() directly. + + YANG Description: List of Explicit Route Objects to be excluded in the +path computation. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """route_object_exclude_object must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__route_object_exclude_object = t + if hasattr(self, '_set'): + self._set() + + def _unset_route_object_exclude_object(self): + self.__route_object_exclude_object = YANGDynClass(base=YANGListType("index",route_object_exclude_object.route_object_exclude_object, yang_name="route-object-exclude-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-exclude-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + route_object_exclude_object = __builtin__.property(_get_route_object_exclude_object, _set_route_object_exclude_object) + + __choices__ = {'algorithm': {'metric': ['route_object_exclude_object']}} + _pyangbind_elements = OrderedDict([('route_object_exclude_object', route_object_exclude_object), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py new file mode 100644 index 000000000..dea360b24 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/__init__.py @@ -0,0 +1,365 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +from . import srlg +class route_object_exclude_object(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of Explicit Route Objects to be excluded in the +path computation. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop','__srlg',) + + _yang_name = 'route-object-exclude-object' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__srlg = YANGDynClass(base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/index (uint32) + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/index (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_srlg(self): + """ + Getter method for srlg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg (container) + + YANG Description: SRLG container. + """ + return self.__srlg + + def _set_srlg(self, v, load=False): + """ + Setter method for srlg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_srlg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_srlg() directly. + + YANG Description: SRLG container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """srlg must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__srlg = t + if hasattr(self, '_set'): + self._set() + + def _unset_srlg(self): + self.__srlg = YANGDynClass(base=srlg.srlg, is_container='container', yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + index = __builtin__.property(_get_index, _set_index) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop, _set_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop, _set_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop, _set_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop, _set_as_number_hop) + label_hop = __builtin__.property(_get_label_hop, _set_label_hop) + srlg = __builtin__.property(_get_srlg, _set_srlg) + + __choices__ = {'algorithm': {'metric': ['index']}, 'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop'], 'srlg': ['srlg']}} + _pyangbind_elements = OrderedDict([('index', index), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ('srlg', srlg), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/__init__.py new file mode 100644 index 000000000..c2450591f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + as_number = __builtin__.property(_get_as_number, _set_as_number) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/__init__.py new file mode 100644 index 000000000..05755c89d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/__init__.py new file mode 100644 index 000000000..aaf805571 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/__init__.py new file mode 100644 index 000000000..f8e446cfb --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + tsg = __builtin__.property(_get_tsg, _set_tsg) + ts_list = __builtin__.property(_get_ts_list, _set_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/__init__.py new file mode 100644 index 000000000..fe5117d92 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/__init__.py new file mode 100644 index 000000000..421eefdb3 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/__init__.py new file mode 100644 index 000000000..e2dd6a91a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/__init__.py @@ -0,0 +1,115 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class srlg(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/srlg. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: SRLG container. + """ + __slots__ = ('_path_helper', '_extmethods', '__srlg',) + + _yang_name = 'srlg' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__srlg = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'srlg'] + + def _get_srlg(self): + """ + Getter method for srlg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/srlg (uint32) + + YANG Description: SRLG value. + """ + return self.__srlg + + def _set_srlg(self, v, load=False): + """ + Setter method for srlg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/srlg/srlg (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_srlg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_srlg() directly. + + YANG Description: SRLG value. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """srlg must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__srlg = t + if hasattr(self, '_set'): + self._set() + + def _unset_srlg(self): + self.__srlg = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="srlg", parent=self, choice=('type', 'srlg'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + srlg = __builtin__.property(_get_srlg, _set_srlg) + + __choices__ = {'type': {'srlg': ['srlg']}} + _pyangbind_elements = OrderedDict([('srlg', srlg), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/__init__.py new file mode 100644 index 000000000..cd0b15cae --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/optimization-metric/explicit-route-exclude-objects/route-object-exclude-object/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'optimization-metric', 'explicit-route-exclude-objects', 'route-object-exclude-object', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_exclude_objects/route_object_exclude_object/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/__init__.py new file mode 100644 index 000000000..2af5c34bd --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import route_object_include_object +class explicit_route_include_objects(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/optimization-metric/explicit-route-include-objects. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the 'include route' object list. + """ + __slots__ = ('_path_helper', '_extmethods', '__route_object_include_object',) + + _yang_name = 'explicit-route-include-objects' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__route_object_include_object = YANGDynClass(base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'optimization-metric', 'explicit-route-include-objects'] + + def _get_route_object_include_object(self): + """ + Getter method for route_object_include_object, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object (list) + + YANG Description: List of Explicit Route Objects to be included in the +path computation. + """ + return self.__route_object_include_object + + def _set_route_object_include_object(self, v, load=False): + """ + Setter method for route_object_include_object, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_route_object_include_object is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_route_object_include_object() directly. + + YANG Description: List of Explicit Route Objects to be included in the +path computation. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """route_object_include_object must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__route_object_include_object = t + if hasattr(self, '_set'): + self._set() + + def _unset_route_object_include_object(self): + self.__route_object_include_object = YANGDynClass(base=YANGListType("index",route_object_include_object.route_object_include_object, yang_name="route-object-include-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="route-object-include-object", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + route_object_include_object = __builtin__.property(_get_route_object_include_object, _set_route_object_include_object) + + __choices__ = {'algorithm': {'metric': ['route_object_include_object']}} + _pyangbind_elements = OrderedDict([('route_object_include_object', route_object_include_object), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py new file mode 100644 index 000000000..43968474b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/__init__.py @@ -0,0 +1,325 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class route_object_include_object(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of Explicit Route Objects to be included in the +path computation. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'route-object-include-object' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/index (uint32) + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/index (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key values. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + index = __builtin__.property(_get_index, _set_index) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop, _set_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop, _set_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop, _set_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop, _set_as_number_hop) + label_hop = __builtin__.property(_get_label_hop, _set_label_hop) + + __choices__ = {'algorithm': {'metric': ['index']}, 'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('index', index), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/__init__.py new file mode 100644 index 000000000..ad6d9db46 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + as_number = __builtin__.property(_get_as_number, _set_as_number) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/__init__.py new file mode 100644 index 000000000..d1ce0f206 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/__init__.py new file mode 100644 index 000000000..66d61a6af --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/__init__.py new file mode 100644 index 000000000..24d91aba6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + tsg = __builtin__.property(_get_tsg, _set_tsg) + ts_list = __builtin__.property(_get_ts_list, _set_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/__init__.py new file mode 100644 index 000000000..bec617c3f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/__init__.py new file mode 100644 index 000000000..6281dee5f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/__init__.py new file mode 100644 index 000000000..9150e2a6e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/optimization-metric/explicit-route-include-objects/route-object-include-object/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'optimization-metric', 'explicit-route-include-objects', 'route-object-include-object', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/optimization_metric/explicit_route_include_objects/route_object_include_object/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/tiebreakers/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/tiebreakers/__init__.py new file mode 100644 index 000000000..f5a272d7f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/tiebreakers/__init__.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import tiebreaker +class tiebreakers(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/tiebreakers. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of tiebreakers. + """ + __slots__ = ('_path_helper', '_extmethods', '__tiebreaker',) + + _yang_name = 'tiebreakers' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tiebreaker = YANGDynClass(base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'tiebreakers'] + + def _get_tiebreaker(self): + """ + Getter method for tiebreaker, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/tiebreakers/tiebreaker (list) + + YANG Description: The list of tiebreaker criteria to apply on an +equally favored set of paths, in order to pick +the best. + """ + return self.__tiebreaker + + def _set_tiebreaker(self, v, load=False): + """ + Setter method for tiebreaker, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/tiebreakers/tiebreaker (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_tiebreaker is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tiebreaker() directly. + + YANG Description: The list of tiebreaker criteria to apply on an +equally favored set of paths, in order to pick +the best. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tiebreaker must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__tiebreaker = t + if hasattr(self, '_set'): + self._set() + + def _unset_tiebreaker(self): + self.__tiebreaker = YANGDynClass(base=YANGListType("tiebreaker_type",tiebreaker.tiebreaker, yang_name="tiebreaker", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tiebreaker-type', extensions=None, choice=('algorithm', 'metric')), is_container='list', yang_name="tiebreaker", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + tiebreaker = __builtin__.property(_get_tiebreaker, _set_tiebreaker) + + __choices__ = {'algorithm': {'metric': ['tiebreaker']}} + _pyangbind_elements = OrderedDict([('tiebreaker', tiebreaker), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/tiebreakers/tiebreaker/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/tiebreakers/tiebreaker/__init__.py new file mode 100644 index 000000000..2a5ad102a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/tiebreakers/tiebreaker/__init__.py @@ -0,0 +1,122 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class tiebreaker(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/optimizations/tiebreakers/tiebreaker. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The list of tiebreaker criteria to apply on an +equally favored set of paths, in order to pick +the best. + """ + __slots__ = ('_path_helper', '_extmethods', '__tiebreaker_type',) + + _yang_name = 'tiebreaker' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tiebreaker_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'optimizations', 'tiebreakers', 'tiebreaker'] + + def _get_tiebreaker_type(self): + """ + Getter method for tiebreaker_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/tiebreakers/tiebreaker/tiebreaker_type (identityref) + + YANG Description: Identifies an entry in the list of tiebreakers. + """ + return self.__tiebreaker_type + + def _set_tiebreaker_type(self, v, load=False): + """ + Setter method for tiebreaker_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/optimizations/tiebreakers/tiebreaker/tiebreaker_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tiebreaker_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tiebreaker_type() directly. + + YANG Description: Identifies an entry in the list of tiebreakers. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tiebreaker_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tiebreaker_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_tiebreaker_type(self): + self.__tiebreaker_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="tiebreaker-type", parent=self, choice=('algorithm', 'metric'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + tiebreaker_type = __builtin__.property(_get_tiebreaker_type, _set_tiebreaker_type) + + __choices__ = {'algorithm': {'metric': ['tiebreaker_type']}} + _pyangbind_elements = OrderedDict([('tiebreaker_type', tiebreaker_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/__init__.py new file mode 100644 index 000000000..995e60b8b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/__init__.py @@ -0,0 +1,523 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_bandwidth +from . import path_metric_bounds +from . import path_affinities_values +from . import path_affinity_names +from . import path_srlgs_lists +from . import path_srlgs_names +class path_constraints(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-constraints. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE named path constraints container. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_bandwidth','__link_protection','__setup_priority','__hold_priority','__signaling_type','__path_metric_bounds','__path_affinities_values','__path_affinity_names','__path_srlgs_lists','__path_srlgs_names','__disjointness',) + + _yang_name = 'path-constraints' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__link_protection = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__setup_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + self.__hold_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + self.__signaling_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__path_metric_bounds = YANGDynClass(base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__disjointness = YANGDynClass(base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-constraints'] + + def _get_te_bandwidth(self): + """ + Getter method for te_bandwidth, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth (container) + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + return self.__te_bandwidth + + def _set_te_bandwidth(self, v, load=False): + """ + Setter method for te_bandwidth, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_bandwidth() directly. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_bandwidth(self): + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_link_protection(self): + """ + Getter method for link_protection, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/link_protection (identityref) + + YANG Description: Link protection type required for the links included +in the computed path. + """ + return self.__link_protection + + def _set_link_protection(self, v, load=False): + """ + Setter method for link_protection, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/link_protection (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_protection is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_protection() directly. + + YANG Description: Link protection type required for the links included +in the computed path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_protection must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__link_protection = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_protection(self): + self.__link_protection = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:link-protection-unprotected"), is_leaf=True, yang_name="link-protection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_setup_priority(self): + """ + Getter method for setup_priority, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/setup_priority (uint8) + + YANG Description: TE LSP requested setup priority. + """ + return self.__setup_priority + + def _set_setup_priority(self, v, load=False): + """ + Setter method for setup_priority, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/setup_priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_setup_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_setup_priority() directly. + + YANG Description: TE LSP requested setup priority. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """setup_priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__setup_priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_setup_priority(self): + self.__setup_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="setup-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + + + def _get_hold_priority(self): + """ + Getter method for hold_priority, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/hold_priority (uint8) + + YANG Description: TE LSP requested hold priority. + """ + return self.__hold_priority + + def _set_hold_priority(self, v, load=False): + """ + Setter method for hold_priority, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/hold_priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_hold_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hold_priority() directly. + + YANG Description: TE LSP requested hold priority. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hold_priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__hold_priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_hold_priority(self): + self.__hold_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(7), is_leaf=True, yang_name="hold-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + + + def _get_signaling_type(self): + """ + Getter method for signaling_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/signaling_type (identityref) + + YANG Description: TE tunnel path signaling type. + """ + return self.__signaling_type + + def _set_signaling_type(self, v, load=False): + """ + Setter method for signaling_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/signaling_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_signaling_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_signaling_type() directly. + + YANG Description: TE tunnel path signaling type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """signaling_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__signaling_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_signaling_type(self): + self.__signaling_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-static': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-rsvp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-setup-sr': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), default=six.text_type("te-types:path-setup-rsvp"), is_leaf=True, yang_name="signaling-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_path_metric_bounds(self): + """ + Getter method for path_metric_bounds, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_metric_bounds (container) + + YANG Description: TE path metric bounds container. + """ + return self.__path_metric_bounds + + def _set_path_metric_bounds(self, v, load=False): + """ + Setter method for path_metric_bounds, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_metric_bounds (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_metric_bounds is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_metric_bounds() directly. + + YANG Description: TE path metric bounds container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_metric_bounds must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_metric_bounds = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_metric_bounds(self): + self.__path_metric_bounds = YANGDynClass(base=path_metric_bounds.path_metric_bounds, is_container='container', yang_name="path-metric-bounds", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_affinities_values(self): + """ + Getter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinities_values (container) + + YANG Description: Path affinities represented as values. + """ + return self.__path_affinities_values + + def _set_path_affinities_values(self, v, load=False): + """ + Setter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinities_values (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_values() directly. + + YANG Description: Path affinities represented as values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_values must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_affinities_values = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_values(self): + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_affinity_names(self): + """ + Getter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names (container) + + YANG Description: Path affinities represented as names. + """ + return self.__path_affinity_names + + def _set_path_affinity_names(self, v, load=False): + """ + Setter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_names() directly. + + YANG Description: Path affinities represented as names. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_affinity_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_names(self): + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_srlgs_lists(self): + """ + Getter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_lists (container) + + YANG Description: Path SRLG properties container. + """ + return self.__path_srlgs_lists + + def _set_path_srlgs_lists(self, v, load=False): + """ + Setter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_lists (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_lists is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_lists() directly. + + YANG Description: Path SRLG properties container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_lists must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_srlgs_lists = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_lists(self): + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_path_srlgs_names(self): + """ + Getter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_names (container) + + YANG Description: Container for the list of named SRLGs. + """ + return self.__path_srlgs_names + + def _set_path_srlgs_names(self, v, load=False): + """ + Setter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_names() directly. + + YANG Description: Container for the list of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__path_srlgs_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_names(self): + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_disjointness(self): + """ + Getter method for disjointness, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/disjointness (te-path-disjointness) + + YANG Description: The type of resource disjointness. +When configured for a primary path, the disjointness level +applies to all secondary LSPs. When configured for a +secondary path, the disjointness level overrides the level +configured for the primary path. + """ + return self.__disjointness + + def _set_disjointness(self, v, load=False): + """ + Setter method for disjointness, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/disjointness (te-path-disjointness) + If this variable is read-only (config: false) in the + source YANG file, then _set_disjointness is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_disjointness() directly. + + YANG Description: The type of resource disjointness. +When configured for a primary path, the disjointness level +applies to all secondary LSPs. When configured for a +secondary path, the disjointness level overrides the level +configured for the primary path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """disjointness must be of a type compatible with te-path-disjointness""", + 'defined-type': "ietf-te-topology:te-path-disjointness", + 'generated-type': """YANGDynClass(base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', is_config=True)""", + }) + + self.__disjointness = t + if hasattr(self, '_set'): + self._set() + + def _unset_disjointness(self): + self.__disjointness = YANGDynClass(base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-path-disjointness', is_config=True) + + te_bandwidth = __builtin__.property(_get_te_bandwidth, _set_te_bandwidth) + link_protection = __builtin__.property(_get_link_protection, _set_link_protection) + setup_priority = __builtin__.property(_get_setup_priority, _set_setup_priority) + hold_priority = __builtin__.property(_get_hold_priority, _set_hold_priority) + signaling_type = __builtin__.property(_get_signaling_type, _set_signaling_type) + path_metric_bounds = __builtin__.property(_get_path_metric_bounds, _set_path_metric_bounds) + path_affinities_values = __builtin__.property(_get_path_affinities_values, _set_path_affinities_values) + path_affinity_names = __builtin__.property(_get_path_affinity_names, _set_path_affinity_names) + path_srlgs_lists = __builtin__.property(_get_path_srlgs_lists, _set_path_srlgs_lists) + path_srlgs_names = __builtin__.property(_get_path_srlgs_names, _set_path_srlgs_names) + disjointness = __builtin__.property(_get_disjointness, _set_disjointness) + + + _pyangbind_elements = OrderedDict([('te_bandwidth', te_bandwidth), ('link_protection', link_protection), ('setup_priority', setup_priority), ('hold_priority', hold_priority), ('signaling_type', signaling_type), ('path_metric_bounds', path_metric_bounds), ('path_affinities_values', path_affinities_values), ('path_affinity_names', path_affinity_names), ('path_srlgs_lists', path_srlgs_lists), ('path_srlgs_names', path_srlgs_names), ('disjointness', disjointness), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinities_values/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinities_values/__init__.py new file mode 100644 index 000000000..d3b86bd00 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinities_values/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_affinities_value +class path_affinities_values(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-constraints/path-affinities-values. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as values. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinities_value',) + + _yang_name = 'path-affinities-values' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-constraints', 'path-affinities-values'] + + def _get_path_affinities_value(self): + """ + Getter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinities_values/path_affinities_value (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinities_value + + def _set_path_affinities_value(self, v, load=False): + """ + Setter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinities_values/path_affinities_value (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_value() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_value must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_affinities_value = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_value(self): + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + path_affinities_value = __builtin__.property(_get_path_affinities_value, _set_path_affinities_value) + + + _pyangbind_elements = OrderedDict([('path_affinities_value', path_affinities_value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinities_values/path_affinities_value/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinities_values/path_affinities_value/__init__.py new file mode 100644 index 000000000..0d53fa7eb --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinities_values/path_affinities_value/__init__.py @@ -0,0 +1,161 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_affinities_value(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-constraints/path-affinities-values/path-affinities-value. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__value',) + + _yang_name = 'path-affinities-value' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-constraints', 'path-affinities-values', 'path-affinities-value'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinities_values/path_affinities_value/usage (identityref) + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinities_values/path_affinities_value/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_value(self): + """ + Getter method for value, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinities_values/path_affinities_value/value (admin-groups) + + YANG Description: The affinity value. The default is empty. + """ + return self.__value + + def _set_value(self, v, load=False): + """ + Setter method for value, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinities_values/path_affinities_value/value (admin-groups) + If this variable is read-only (config: false) in the + source YANG file, then _set_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_value() directly. + + YANG Description: The affinity value. The default is empty. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """value must be of a type compatible with admin-groups""", + 'defined-type': "ietf-te-topology:admin-groups", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=True)""", + }) + + self.__value = t + if hasattr(self, '_set'): + self._set() + + def _unset_value(self): + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=True) + + usage = __builtin__.property(_get_usage, _set_usage) + value = __builtin__.property(_get_value, _set_value) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('value', value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/__init__.py new file mode 100644 index 000000000..915eb1efb --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_affinity_name +class path_affinity_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-constraints/path-affinity-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as names. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinity_name',) + + _yang_name = 'path-affinity-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-constraints', 'path-affinity-names'] + + def _get_path_affinity_name(self): + """ + Getter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/path_affinity_name (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinity_name + + def _set_path_affinity_name(self, v, load=False): + """ + Setter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/path_affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_name() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_name(self): + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + path_affinity_name = __builtin__.property(_get_path_affinity_name, _set_path_affinity_name) + + + _pyangbind_elements = OrderedDict([('path_affinity_name', path_affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/path_affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/path_affinity_name/__init__.py new file mode 100644 index 000000000..f4886c5ce --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/path_affinity_name/__init__.py @@ -0,0 +1,162 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import affinity_name +class path_affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-constraints/path-affinity-names/path-affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__affinity_name',) + + _yang_name = 'path-affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-constraints', 'path-affinity-names', 'path-affinity-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/path_affinity_name/usage (identityref) + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/path_affinity_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_affinity_name(self): + """ + Getter method for affinity_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/path_affinity_name/affinity_name (list) + + YANG Description: List of named affinities. + """ + return self.__affinity_name + + def _set_affinity_name(self, v, load=False): + """ + Setter method for affinity_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/path_affinity_name/affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_affinity_name() directly. + + YANG Description: List of named affinities. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_affinity_name(self): + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + usage = __builtin__.property(_get_usage, _set_usage) + affinity_name = __builtin__.property(_get_affinity_name, _set_affinity_name) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('affinity_name', affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py new file mode 100644 index 000000000..2a14ea23b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/path_affinity_name/affinity_name/__init__.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-constraints/path-affinity-names/path-affinity-name/affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinities. + """ + __slots__ = ('_path_helper', '_extmethods', '__name',) + + _yang_name = 'affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-constraints', 'path-affinity-names', 'path-affinity-name', 'affinity-name'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/path_affinity_name/affinity_name/name (string) + + YANG Description: Identifies a named affinity entry. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_affinity_names/path_affinity_name/affinity_name/name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: Identifies a named affinity entry. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + name = __builtin__.property(_get_name, _set_name) + + + _pyangbind_elements = OrderedDict([('name', name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_metric_bounds/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_metric_bounds/__init__.py new file mode 100644 index 000000000..9a35d6f91 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_metric_bounds/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_metric_bound +class path_metric_bounds(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-constraints/path-metric-bounds. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE path metric bounds container. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_metric_bound',) + + _yang_name = 'path-metric-bounds' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_metric_bound = YANGDynClass(base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-constraints', 'path-metric-bounds'] + + def _get_path_metric_bound(self): + """ + Getter method for path_metric_bound, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_metric_bounds/path_metric_bound (list) + + YANG Description: List of TE path metric bounds. + """ + return self.__path_metric_bound + + def _set_path_metric_bound(self, v, load=False): + """ + Setter method for path_metric_bound, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_metric_bounds/path_metric_bound (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_metric_bound is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_metric_bound() directly. + + YANG Description: List of TE path metric bounds. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_metric_bound must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_metric_bound = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_metric_bound(self): + self.__path_metric_bound = YANGDynClass(base=YANGListType("metric_type",path_metric_bound.path_metric_bound, yang_name="path-metric-bound", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + path_metric_bound = __builtin__.property(_get_path_metric_bound, _set_path_metric_bound) + + + _pyangbind_elements = OrderedDict([('path_metric_bound', path_metric_bound), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_metric_bounds/path_metric_bound/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_metric_bounds/path_metric_bound/__init__.py new file mode 100644 index 000000000..c015281ab --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_metric_bounds/path_metric_bound/__init__.py @@ -0,0 +1,165 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_metric_bound(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-constraints/path-metric-bounds/path-metric-bound. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of TE path metric bounds. + """ + __slots__ = ('_path_helper', '_extmethods', '__metric_type','__upper_bound',) + + _yang_name = 'path-metric-bound' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__upper_bound = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-constraints', 'path-metric-bounds', 'path-metric-bound'] + + def _get_metric_type(self): + """ + Getter method for metric_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_metric_bounds/path_metric_bound/metric_type (identityref) + + YANG Description: Identifies an entry in the list of 'metric-type' items +bound for the TE path. + """ + return self.__metric_type + + def _set_metric_type(self, v, load=False): + """ + Setter method for metric_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_metric_bounds/path_metric_bound/metric_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_metric_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_metric_type() directly. + + YANG Description: Identifies an entry in the list of 'metric-type' items +bound for the TE path. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """metric_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__metric_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_metric_type(self): + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_upper_bound(self): + """ + Getter method for upper_bound, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_metric_bounds/path_metric_bound/upper_bound (uint64) + + YANG Description: Upper bound on the end-to-end TE path metric. A zero +indicates an unbounded upper limit for the specific +'metric-type'. + """ + return self.__upper_bound + + def _set_upper_bound(self, v, load=False): + """ + Setter method for upper_bound, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_metric_bounds/path_metric_bound/upper_bound (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_upper_bound is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_upper_bound() directly. + + YANG Description: Upper bound on the end-to-end TE path metric. A zero +indicates an unbounded upper limit for the specific +'metric-type'. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """upper_bound must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__upper_bound = t + if hasattr(self, '_set'): + self._set() + + def _unset_upper_bound(self): + self.__upper_bound = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64)(0), is_leaf=True, yang_name="upper-bound", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=True) + + metric_type = __builtin__.property(_get_metric_type, _set_metric_type) + upper_bound = __builtin__.property(_get_upper_bound, _set_upper_bound) + + + _pyangbind_elements = OrderedDict([('metric_type', metric_type), ('upper_bound', upper_bound), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_lists/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_lists/__init__.py new file mode 100644 index 000000000..1be416c5f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_lists/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_srlgs_list +class path_srlgs_lists(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-constraints/path-srlgs-lists. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path SRLG properties container. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_list',) + + _yang_name = 'path-srlgs-lists' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-constraints', 'path-srlgs-lists'] + + def _get_path_srlgs_list(self): + """ + Getter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_lists/path_srlgs_list (list) + + YANG Description: List of SRLG values to be included or excluded. + """ + return self.__path_srlgs_list + + def _set_path_srlgs_list(self, v, load=False): + """ + Setter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_lists/path_srlgs_list (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_list() directly. + + YANG Description: List of SRLG values to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_list must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_srlgs_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_list(self): + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + path_srlgs_list = __builtin__.property(_get_path_srlgs_list, _set_path_srlgs_list) + + + _pyangbind_elements = OrderedDict([('path_srlgs_list', path_srlgs_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py new file mode 100644 index 000000000..656884a88 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_lists/path_srlgs_list/__init__.py @@ -0,0 +1,161 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_srlgs_list(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-constraints/path-srlgs-lists/path-srlgs-list. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of SRLG values to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__values',) + + _yang_name = 'path-srlgs-list' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-constraints', 'path-srlgs-lists', 'path-srlgs-list'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_lists/path_srlgs_list/usage (identityref) + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_lists/path_srlgs_list/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_values(self): + """ + Getter method for values, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_lists/path_srlgs_list/values (srlg) + + YANG Description: List of SRLG values. + """ + return self.__values + + def _set_values(self, v, load=False): + """ + Setter method for values, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_lists/path_srlgs_list/values (srlg) + If this variable is read-only (config: false) in the + source YANG file, then _set_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_values() directly. + + YANG Description: List of SRLG values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """values must be of a type compatible with srlg""", + 'defined-type': "ietf-te-topology:srlg", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=True)""", + }) + + self.__values = t + if hasattr(self, '_set'): + self._set() + + def _unset_values(self): + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=True) + + usage = __builtin__.property(_get_usage, _set_usage) + values = __builtin__.property(_get_values, _set_values) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('values', values), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_names/__init__.py new file mode 100644 index 000000000..0e50a196f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_names/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_srlgs_name +class path_srlgs_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-constraints/path-srlgs-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of named SRLGs. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_name',) + + _yang_name = 'path-srlgs-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-constraints', 'path-srlgs-names'] + + def _get_path_srlgs_name(self): + """ + Getter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_names/path_srlgs_name (list) + + YANG Description: List of named SRLGs to be included or excluded. + """ + return self.__path_srlgs_name + + def _set_path_srlgs_name(self, v, load=False): + """ + Setter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_names/path_srlgs_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_name() directly. + + YANG Description: List of named SRLGs to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_srlgs_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_name(self): + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + path_srlgs_name = __builtin__.property(_get_path_srlgs_name, _set_path_srlgs_name) + + + _pyangbind_elements = OrderedDict([('path_srlgs_name', path_srlgs_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py new file mode 100644 index 000000000..4010d6485 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_names/path_srlgs_name/__init__.py @@ -0,0 +1,161 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_srlgs_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-constraints/path-srlgs-names/path-srlgs-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named SRLGs to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__names',) + + _yang_name = 'path-srlgs-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-constraints', 'path-srlgs-names', 'path-srlgs-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_names/path_srlgs_name/usage (identityref) + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_names/path_srlgs_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_names(self): + """ + Getter method for names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_names/path_srlgs_name/names (string) + + YANG Description: List of named SRLGs. + """ + return self.__names + + def _set_names(self, v, load=False): + """ + Setter method for names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/path_srlgs_names/path_srlgs_name/names (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_names() directly. + + YANG Description: List of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """names must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True)""", + }) + + self.__names = t + if hasattr(self, '_set'): + self._set() + + def _unset_names(self): + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + usage = __builtin__.property(_get_usage, _set_usage) + names = __builtin__.property(_get_names, _set_names) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('names', names), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/__init__.py new file mode 100644 index 000000000..82e5ccc65 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/__init__.py @@ -0,0 +1,195 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-constraints/te-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_bandwidth',) + + _yang_name = 'te-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-constraints', 'te-bandwidth'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/generic (te-bandwidth) + + YANG Description: Bandwidth specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/generic (te-bandwidth) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Bandwidth specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with te-bandwidth""", + 'defined-type': "ietf-te-topology:te-bandwidth", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/otn (container) + + YANG Description: Bandwidth attributes for OTN links + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Bandwidth attributes for OTN links + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_eth_bandwidth(self): + """ + Getter method for eth_bandwidth, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/eth_bandwidth (uint64) + + YANG Description: Available bandwith value expressed in kilobits per second + """ + return self.__eth_bandwidth + + def _set_eth_bandwidth(self, v, load=False): + """ + Setter method for eth_bandwidth, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/eth_bandwidth (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_bandwidth() directly. + + YANG Description: Available bandwith value expressed in kilobits per second + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_bandwidth must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__eth_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_bandwidth(self): + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + eth_bandwidth = __builtin__.property(_get_eth_bandwidth, _set_eth_bandwidth) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['eth_bandwidth']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_bandwidth', eth_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/otn/__init__.py new file mode 100644 index 000000000..43c1a9a43 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/otn/__init__.py @@ -0,0 +1,163 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import odulist +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-constraints/te-bandwidth/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Bandwidth attributes for OTN links + """ + __slots__ = ('_path_helper', '_extmethods', '__odulist','__odtu_flex_type',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + self.__odtu_flex_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-constraints', 'te-bandwidth', 'otn'] + + def _get_odulist(self): + """ + Getter method for odulist, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/otn/odulist (list) + + YANG Description: OTN bandwidth definition + """ + return self.__odulist + + def _set_odulist(self, v, load=False): + """ + Setter method for odulist, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/otn/odulist (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_odulist is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odulist() directly. + + YANG Description: OTN bandwidth definition + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odulist must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True)""", + }) + + self.__odulist = t + if hasattr(self, '_set'): + self._set() + + def _unset_odulist(self): + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None, choice=('technology', 'otn')), is_container='list', yang_name="odulist", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + + + def _get_odtu_flex_type(self): + """ + Getter method for odtu_flex_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/otn/odtu_flex_type (l1-types:odtu-flex-type) + + YANG Description: The type of Optical Data Tributary Unit (ODTU) +whose nominal bitrate is used to compute the number of +Tributary Slots (TS) required by the ODUflex LSPs +set up along the underlay paths of these OTN Local +Link Connectivities. + """ + return self.__odtu_flex_type + + def _set_odtu_flex_type(self, v, load=False): + """ + Setter method for odtu_flex_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/otn/odtu_flex_type (l1-types:odtu-flex-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_odtu_flex_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odtu_flex_type() directly. + + YANG Description: The type of Optical Data Tributary Unit (ODTU) +whose nominal bitrate is used to compute the number of +Tributary Slots (TS) required by the ODUflex LSPs +set up along the underlay paths of these OTN Local +Link Connectivities. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odtu_flex_type must be of a type compatible with l1-types:odtu-flex-type""", + 'defined-type': "l1-types:odtu-flex-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True)""", + }) + + self.__odtu_flex_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odtu_flex_type(self): + self.__odtu_flex_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True) + + odulist = __builtin__.property(_get_odulist, _set_odulist) + odtu_flex_type = __builtin__.property(_get_odtu_flex_type, _set_odtu_flex_type) + + __choices__ = {'technology': {'otn': ['odulist', 'odtu_flex_type']}} + _pyangbind_elements = OrderedDict([('odulist', odulist), ('odtu_flex_type', odtu_flex_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/otn/odulist/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/otn/odulist/__init__.py new file mode 100644 index 000000000..637f3a83b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/otn/odulist/__init__.py @@ -0,0 +1,200 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class odulist(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-constraints/te-bandwidth/otn/odulist. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: OTN bandwidth definition + """ + __slots__ = ('_path_helper', '_extmethods', '__odu_type','__number','__ts_number',) + + _yang_name = 'odulist' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-constraints', 'te-bandwidth', 'otn', 'odulist'] + + def _get_odu_type(self): + """ + Getter method for odu_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/otn/odulist/odu_type (identityref) + + YANG Description: ODU type + """ + return self.__odu_type + + def _set_odu_type(self, v, load=False): + """ + Setter method for odu_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/otn/odulist/odu_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type() directly. + + YANG Description: ODU type + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__odu_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type(self): + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_number(self): + """ + Getter method for number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/otn/odulist/number (uint16) + + YANG Description: Number of ODUs + """ + return self.__number + + def _set_number(self, v, load=False): + """ + Setter method for number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/otn/odulist/number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_number() directly. + + YANG Description: Number of ODUs + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__number = t + if hasattr(self, '_set'): + self._set() + + def _unset_number(self): + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + + def _get_ts_number(self): + """ + Getter method for ts_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/otn/odulist/ts_number (uint16) + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + return self.__ts_number + + def _set_ts_number(self, v, load=False): + """ + Setter method for ts_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_constraints/te_bandwidth/otn/odulist/ts_number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_number() directly. + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__ts_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_number(self): + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + odu_type = __builtin__.property(_get_odu_type, _set_odu_type) + number = __builtin__.property(_get_number, _set_number) + ts_number = __builtin__.property(_get_ts_number, _set_ts_number) + + __choices__ = {'technology': {'otn': ['odu_type', 'number', 'ts_number']}} + _pyangbind_elements = OrderedDict([('odu_type', odu_type), ('number', number), ('ts_number', ts_number), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/__init__.py new file mode 100644 index 000000000..121cb2026 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/__init__.py @@ -0,0 +1,318 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_metric +from . import path_affinities_values +from . import path_affinity_names +from . import path_srlgs_lists +from . import path_srlgs_names +from . import path_route_objects +class path_properties(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-properties. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The TE path properties. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_metric','__path_affinities_values','__path_affinity_names','__path_srlgs_lists','__path_srlgs_names','__path_route_objects',) + + _yang_name = 'path-properties' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_metric = YANGDynClass(base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__path_route_objects = YANGDynClass(base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-properties'] + + def _get_path_metric(self): + """ + Getter method for path_metric, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_metric (list) + + YANG Description: TE path metric type. + """ + return self.__path_metric + + def _set_path_metric(self, v, load=False): + """ + Setter method for path_metric, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_metric (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_metric is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_metric() directly. + + YANG Description: TE path metric type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_metric must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_metric = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_metric(self): + self.__path_metric = YANGDynClass(base=YANGListType("metric_type",path_metric.path_metric, yang_name="path-metric", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='metric-type', extensions=None), is_container='list', yang_name="path-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + + def _get_path_affinities_values(self): + """ + Getter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinities_values (container) + + YANG Description: Path affinities represented as values. + """ + return self.__path_affinities_values + + def _set_path_affinities_values(self, v, load=False): + """ + Setter method for path_affinities_values, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinities_values (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_values() directly. + + YANG Description: Path affinities represented as values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_values must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_affinities_values = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_values(self): + self.__path_affinities_values = YANGDynClass(base=path_affinities_values.path_affinities_values, is_container='container', yang_name="path-affinities-values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_affinity_names(self): + """ + Getter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names (container) + + YANG Description: Path affinities represented as names. + """ + return self.__path_affinity_names + + def _set_path_affinity_names(self, v, load=False): + """ + Setter method for path_affinity_names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_names() directly. + + YANG Description: Path affinities represented as names. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_affinity_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_names(self): + self.__path_affinity_names = YANGDynClass(base=path_affinity_names.path_affinity_names, is_container='container', yang_name="path-affinity-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_srlgs_lists(self): + """ + Getter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_lists (container) + + YANG Description: Path SRLG properties container. + """ + return self.__path_srlgs_lists + + def _set_path_srlgs_lists(self, v, load=False): + """ + Setter method for path_srlgs_lists, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_lists (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_lists is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_lists() directly. + + YANG Description: Path SRLG properties container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_lists must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_srlgs_lists = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_lists(self): + self.__path_srlgs_lists = YANGDynClass(base=path_srlgs_lists.path_srlgs_lists, is_container='container', yang_name="path-srlgs-lists", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_srlgs_names(self): + """ + Getter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_names (container) + + YANG Description: Container for the list of named SRLGs. + """ + return self.__path_srlgs_names + + def _set_path_srlgs_names(self, v, load=False): + """ + Setter method for path_srlgs_names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_names (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_names() directly. + + YANG Description: Container for the list of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_names must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_srlgs_names = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_names(self): + self.__path_srlgs_names = YANGDynClass(base=path_srlgs_names.path_srlgs_names, is_container='container', yang_name="path-srlgs-names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_path_route_objects(self): + """ + Getter method for path_route_objects, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects (container) + + YANG Description: Container for the list of route objects either returned by +the computation engine or actually used by an LSP. + """ + return self.__path_route_objects + + def _set_path_route_objects(self, v, load=False): + """ + Setter method for path_route_objects, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_route_objects is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_route_objects() directly. + + YANG Description: Container for the list of route objects either returned by +the computation engine or actually used by an LSP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_route_objects must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__path_route_objects = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_route_objects(self): + self.__path_route_objects = YANGDynClass(base=path_route_objects.path_route_objects, is_container='container', yang_name="path-route-objects", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + path_metric = __builtin__.property(_get_path_metric) + path_affinities_values = __builtin__.property(_get_path_affinities_values) + path_affinity_names = __builtin__.property(_get_path_affinity_names) + path_srlgs_lists = __builtin__.property(_get_path_srlgs_lists) + path_srlgs_names = __builtin__.property(_get_path_srlgs_names) + path_route_objects = __builtin__.property(_get_path_route_objects) + + + _pyangbind_elements = OrderedDict([('path_metric', path_metric), ('path_affinities_values', path_affinities_values), ('path_affinity_names', path_affinity_names), ('path_srlgs_lists', path_srlgs_lists), ('path_srlgs_names', path_srlgs_names), ('path_route_objects', path_route_objects), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinities_values/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinities_values/__init__.py new file mode 100644 index 000000000..5f23f944f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinities_values/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_affinities_value +class path_affinities_values(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-properties/path-affinities-values. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as values. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinities_value',) + + _yang_name = 'path-affinities-values' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-properties', 'path-affinities-values'] + + def _get_path_affinities_value(self): + """ + Getter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinities_values/path_affinities_value (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinities_value + + def _set_path_affinities_value(self, v, load=False): + """ + Setter method for path_affinities_value, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinities_values/path_affinities_value (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinities_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinities_value() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinities_value must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_affinities_value = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinities_value(self): + self.__path_affinities_value = YANGDynClass(base=YANGListType("usage",path_affinities_value.path_affinities_value, yang_name="path-affinities-value", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinities-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_affinities_value = __builtin__.property(_get_path_affinities_value) + + + _pyangbind_elements = OrderedDict([('path_affinities_value', path_affinities_value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinities_values/path_affinities_value/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinities_values/path_affinities_value/__init__.py new file mode 100644 index 000000000..6e7ba3ec4 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinities_values/path_affinities_value/__init__.py @@ -0,0 +1,161 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_affinities_value(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-properties/path-affinities-values/path-affinities-value. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__value',) + + _yang_name = 'path-affinities-value' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-properties', 'path-affinities-values', 'path-affinities-value'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinities_values/path_affinities_value/usage (identityref) + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinities_values/path_affinities_value/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of value affinity +constraints. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_value(self): + """ + Getter method for value, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinities_values/path_affinities_value/value (admin-groups) + + YANG Description: The affinity value. The default is empty. + """ + return self.__value + + def _set_value(self, v, load=False): + """ + Setter method for value, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinities_values/path_affinities_value/value (admin-groups) + If this variable is read-only (config: false) in the + source YANG file, then _set_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_value() directly. + + YANG Description: The affinity value. The default is empty. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """value must be of a type compatible with admin-groups""", + 'defined-type': "ietf-te-topology:admin-groups", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False)""", + }) + + self.__value = t + if hasattr(self, '_set'): + self._set() + + def _unset_value(self): + self.__value = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], default=six.text_type(""), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='admin-groups', is_config=False) + + usage = __builtin__.property(_get_usage) + value = __builtin__.property(_get_value) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('value', value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/__init__.py new file mode 100644 index 000000000..75ec7e310 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_affinity_name +class path_affinity_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-properties/path-affinity-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path affinities represented as names. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_affinity_name',) + + _yang_name = 'path-affinity-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-properties', 'path-affinity-names'] + + def _get_path_affinity_name(self): + """ + Getter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/path_affinity_name (list) + + YANG Description: List of named affinity constraints. + """ + return self.__path_affinity_name + + def _set_path_affinity_name(self, v, load=False): + """ + Setter method for path_affinity_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/path_affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_affinity_name() directly. + + YANG Description: List of named affinity constraints. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_affinity_name(self): + self.__path_affinity_name = YANGDynClass(base=YANGListType("usage",path_affinity_name.path_affinity_name, yang_name="path-affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_affinity_name = __builtin__.property(_get_path_affinity_name) + + + _pyangbind_elements = OrderedDict([('path_affinity_name', path_affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/path_affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/path_affinity_name/__init__.py new file mode 100644 index 000000000..6d2740363 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/path_affinity_name/__init__.py @@ -0,0 +1,162 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import affinity_name +class path_affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-properties/path-affinity-names/path-affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinity constraints. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__affinity_name',) + + _yang_name = 'path-affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-properties', 'path-affinity-names', 'path-affinity-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/path_affinity_name/usage (identityref) + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/path_affinity_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in the list of named affinity +constraints. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-all': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-include-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:resource-aff-exclude-any': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_affinity_name(self): + """ + Getter method for affinity_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/path_affinity_name/affinity_name (list) + + YANG Description: List of named affinities. + """ + return self.__affinity_name + + def _set_affinity_name(self, v, load=False): + """ + Setter method for affinity_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/path_affinity_name/affinity_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_affinity_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_affinity_name() directly. + + YANG Description: List of named affinities. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """affinity_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__affinity_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_affinity_name(self): + self.__affinity_name = YANGDynClass(base=YANGListType("name",affinity_name.affinity_name, yang_name="affinity-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="affinity-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + usage = __builtin__.property(_get_usage) + affinity_name = __builtin__.property(_get_affinity_name) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('affinity_name', affinity_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py new file mode 100644 index 000000000..d00d8136a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/path_affinity_name/affinity_name/__init__.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class affinity_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-properties/path-affinity-names/path-affinity-name/affinity-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named affinities. + """ + __slots__ = ('_path_helper', '_extmethods', '__name',) + + _yang_name = 'affinity-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-properties', 'path-affinity-names', 'path-affinity-name', 'affinity-name'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/path_affinity_name/affinity_name/name (string) + + YANG Description: Identifies a named affinity entry. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_affinity_names/path_affinity_name/affinity_name/name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: Identifies a named affinity entry. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + name = __builtin__.property(_get_name) + + + _pyangbind_elements = OrderedDict([('name', name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_metric/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_metric/__init__.py new file mode 100644 index 000000000..34ad252cf --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_metric/__init__.py @@ -0,0 +1,159 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_metric(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-properties/path-metric. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE path metric type. + """ + __slots__ = ('_path_helper', '_extmethods', '__metric_type','__accumulative_value',) + + _yang_name = 'path-metric' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__accumulative_value = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-properties', 'path-metric'] + + def _get_metric_type(self): + """ + Getter method for metric_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_metric/metric_type (identityref) + + YANG Description: TE path metric type. + """ + return self.__metric_type + + def _set_metric_type(self, v, load=False): + """ + Setter method for metric_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_metric/metric_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_metric_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_metric_type() directly. + + YANG Description: TE path metric type. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """metric_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__metric_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_metric_type(self): + self.__metric_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-te': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-igp': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-hop': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-average': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-delay-minimum': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-includes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:path-metric-optimize-excludes': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="metric-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_accumulative_value(self): + """ + Getter method for accumulative_value, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_metric/accumulative_value (uint64) + + YANG Description: TE path metric accumulative value. + """ + return self.__accumulative_value + + def _set_accumulative_value(self, v, load=False): + """ + Setter method for accumulative_value, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_metric/accumulative_value (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_accumulative_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_accumulative_value() directly. + + YANG Description: TE path metric accumulative value. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """accumulative_value must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False)""", + }) + + self.__accumulative_value = t + if hasattr(self, '_set'): + self._set() + + def _unset_accumulative_value(self): + self.__accumulative_value = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="accumulative-value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=False) + + metric_type = __builtin__.property(_get_metric_type) + accumulative_value = __builtin__.property(_get_accumulative_value) + + + _pyangbind_elements = OrderedDict([('metric_type', metric_type), ('accumulative_value', accumulative_value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/__init__.py new file mode 100644 index 000000000..826eb49d2 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/__init__.py @@ -0,0 +1,119 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_route_object +class path_route_objects(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-properties/path-route-objects. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of route objects either returned by +the computation engine or actually used by an LSP. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_route_object',) + + _yang_name = 'path-route-objects' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_route_object = YANGDynClass(base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-properties', 'path-route-objects'] + + def _get_path_route_object(self): + """ + Getter method for path_route_object, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object (list) + + YANG Description: List of route objects either returned by the computation +engine or actually used by an LSP. + """ + return self.__path_route_object + + def _set_path_route_object(self, v, load=False): + """ + Setter method for path_route_object, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_route_object is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_route_object() directly. + + YANG Description: List of route objects either returned by the computation +engine or actually used by an LSP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_route_object must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_route_object = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_route_object(self): + self.__path_route_object = YANGDynClass(base=YANGListType("index",path_route_object.path_route_object, yang_name="path-route-object", parent=self, is_container='list', user_ordered=True, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="path-route-object", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_route_object = __builtin__.property(_get_path_route_object) + + + _pyangbind_elements = OrderedDict([('path_route_object', path_route_object), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/__init__.py new file mode 100644 index 000000000..3f433dc1f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/__init__.py @@ -0,0 +1,327 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class path_route_object(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-properties/path-route-objects/path-route-object. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of route objects either returned by the computation +engine or actually used by an LSP. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'path-route-object' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-properties', 'path-route-objects', 'path-route-object'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/index (uint32) + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key +values. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/index (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: Route object entry index. The index is used to +identify an entry in the list. The order of entries +is defined by the user without relying on key +values. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=False) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + index = __builtin__.property(_get_index) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop) + label_hop = __builtin__.property(_get_label_hop) + + __choices__ = {'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('index', index), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/as_number_hop/__init__.py new file mode 100644 index 000000000..f8ad1dc66 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-properties/path-route-objects/path-route-object/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-properties', 'path-route-objects', 'path-route-object', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + as_number = __builtin__.property(_get_as_number) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/__init__.py new file mode 100644 index 000000000..c577696ea --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-properties/path-route-objects/path-route-object/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-properties', 'path-route-objects', 'path-route-object', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + te_label = __builtin__.property(_get_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label/__init__.py new file mode 100644 index 000000000..e8bc5dd22 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-properties/path-route-objects/path-route-object/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-properties', 'path-route-objects', 'path-route-object', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=False) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=False) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=False) + + generic = __builtin__.property(_get_generic) + otn = __builtin__.property(_get_otn) + vlanid = __builtin__.property(_get_vlanid) + direction = __builtin__.property(_get_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/__init__.py new file mode 100644 index 000000000..15655b7d1 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-properties/path-route-objects/path-route-object/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-properties', 'path-route-objects', 'path-route-object', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=False) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=False) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=False) + + tpn = __builtin__.property(_get_tpn) + tsg = __builtin__.property(_get_tsg) + ts_list = __builtin__.property(_get_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/numbered_link_hop/__init__.py new file mode 100644 index 000000000..417bcf3cf --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-properties/path-route-objects/path-route-object/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-properties', 'path-route-objects', 'path-route-object', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/numbered_node_hop/__init__.py new file mode 100644 index 000000000..bef8709eb --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-properties/path-route-objects/path-route-object/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-properties', 'path-route-objects', 'path-route-object', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/numbered_node_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/__init__.py new file mode 100644 index 000000000..255ef9336 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-properties/path-route-objects/path-route-object/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-properties', 'path-route-objects', 'path-route-object', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=False) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=False) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=False) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_route_objects/path_route_object/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=False) + + link_tp_id = __builtin__.property(_get_link_tp_id) + node_id = __builtin__.property(_get_node_id) + hop_type = __builtin__.property(_get_hop_type) + direction = __builtin__.property(_get_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_lists/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_lists/__init__.py new file mode 100644 index 000000000..ecfdfafc0 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_lists/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_srlgs_list +class path_srlgs_lists(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-properties/path-srlgs-lists. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Path SRLG properties container. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_list',) + + _yang_name = 'path-srlgs-lists' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-properties', 'path-srlgs-lists'] + + def _get_path_srlgs_list(self): + """ + Getter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_lists/path_srlgs_list (list) + + YANG Description: List of SRLG values to be included or excluded. + """ + return self.__path_srlgs_list + + def _set_path_srlgs_list(self, v, load=False): + """ + Setter method for path_srlgs_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_lists/path_srlgs_list (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_list() directly. + + YANG Description: List of SRLG values to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_list must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_srlgs_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_list(self): + self.__path_srlgs_list = YANGDynClass(base=YANGListType("usage",path_srlgs_list.path_srlgs_list, yang_name="path-srlgs-list", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_srlgs_list = __builtin__.property(_get_path_srlgs_list) + + + _pyangbind_elements = OrderedDict([('path_srlgs_list', path_srlgs_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py new file mode 100644 index 000000000..14fb3f2b0 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_lists/path_srlgs_list/__init__.py @@ -0,0 +1,161 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_srlgs_list(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-properties/path-srlgs-lists/path-srlgs-list. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of SRLG values to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__values',) + + _yang_name = 'path-srlgs-list' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-properties', 'path-srlgs-lists', 'path-srlgs-list'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_lists/path_srlgs_list/usage (identityref) + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_lists/path_srlgs_list/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of SRLGs to either +include or exclude. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_values(self): + """ + Getter method for values, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_lists/path_srlgs_list/values (srlg) + + YANG Description: List of SRLG values. + """ + return self.__values + + def _set_values(self, v, load=False): + """ + Setter method for values, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_lists/path_srlgs_list/values (srlg) + If this variable is read-only (config: false) in the + source YANG file, then _set_values is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_values() directly. + + YANG Description: List of SRLG values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """values must be of a type compatible with srlg""", + 'defined-type': "ietf-te-topology:srlg", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False)""", + }) + + self.__values = t + if hasattr(self, '_set'): + self._set() + + def _unset_values(self): + self.__values = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="values", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='srlg', is_config=False) + + usage = __builtin__.property(_get_usage) + values = __builtin__.property(_get_values) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('values', values), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_names/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_names/__init__.py new file mode 100644 index 000000000..48d9f8f04 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_names/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_srlgs_name +class path_srlgs_names(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-properties/path-srlgs-names. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container for the list of named SRLGs. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_srlgs_name',) + + _yang_name = 'path-srlgs-names' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-properties', 'path-srlgs-names'] + + def _get_path_srlgs_name(self): + """ + Getter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_names/path_srlgs_name (list) + + YANG Description: List of named SRLGs to be included or excluded. + """ + return self.__path_srlgs_name + + def _set_path_srlgs_name(self, v, load=False): + """ + Setter method for path_srlgs_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_names/path_srlgs_name (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_srlgs_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_srlgs_name() directly. + + YANG Description: List of named SRLGs to be included or excluded. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_srlgs_name must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False)""", + }) + + self.__path_srlgs_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_srlgs_name(self): + self.__path_srlgs_name = YANGDynClass(base=YANGListType("usage",path_srlgs_name.path_srlgs_name, yang_name="path-srlgs-name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='usage', extensions=None), is_container='list', yang_name="path-srlgs-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=False) + + path_srlgs_name = __builtin__.property(_get_path_srlgs_name) + + + _pyangbind_elements = OrderedDict([('path_srlgs_name', path_srlgs_name), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_names/path_srlgs_name/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_names/path_srlgs_name/__init__.py new file mode 100644 index 000000000..874fef349 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_names/path_srlgs_name/__init__.py @@ -0,0 +1,161 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class path_srlgs_name(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/path-properties/path-srlgs-names/path-srlgs-name. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of named SRLGs to be included or excluded. + """ + __slots__ = ('_path_helper', '_extmethods', '__usage','__names',) + + _yang_name = 'path-srlgs-name' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'path-properties', 'path-srlgs-names', 'path-srlgs-name'] + + def _get_usage(self): + """ + Getter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_names/path_srlgs_name/usage (identityref) + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + return self.__usage + + def _set_usage(self, v, load=False): + """ + Setter method for usage, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_names/path_srlgs_name/usage (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_usage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_usage() directly. + + YANG Description: Identifies an entry in a list of named SRLGs to either +include or exclude. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """usage must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False)""", + }) + + self.__usage = t + if hasattr(self, '_set'): + self._set() + + def _unset_usage(self): + self.__usage = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-include-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-object': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:route-exclude-srlg': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="usage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=False) + + + def _get_names(self): + """ + Getter method for names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_names/path_srlgs_name/names (string) + + YANG Description: List of named SRLGs. + """ + return self.__names + + def _set_names(self, v, load=False): + """ + Setter method for names, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/path_properties/path_srlgs_names/path_srlgs_name/names (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_names is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_names() directly. + + YANG Description: List of named SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """names must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False)""", + }) + + self.__names = t + if hasattr(self, '_set'): + self._set() + + def _unset_names(self): + self.__names = YANGDynClass(unique=True, base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="names", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=False) + + usage = __builtin__.property(_get_usage) + names = __builtin__.property(_get_names) + + + _pyangbind_elements = OrderedDict([('usage', usage), ('names', names), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/__init__.py new file mode 100644 index 000000000..e1d683aeb --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/__init__.py @@ -0,0 +1,326 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import primary_path +from . import backup_path +from . import tunnel_termination_points +from . import tunnels +class underlay(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/underlay. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Attributes of the TE link underlay. + """ + __slots__ = ('_path_helper', '_extmethods', '__enabled','__primary_path','__backup_path','__protection_type','__tunnel_termination_points','__tunnels',) + + _yang_name = 'underlay' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__enabled = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + self.__primary_path = YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__backup_path = YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + self.__protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__tunnel_termination_points = YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__tunnels = YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'underlay'] + + def _get_enabled(self): + """ + Getter method for enabled, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/enabled (boolean) + + YANG Description: 'true' if the underlay is enabled. +'false' if the underlay is disabled. + """ + return self.__enabled + + def _set_enabled(self, v, load=False): + """ + Setter method for enabled, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/enabled (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_enabled is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_enabled() directly. + + YANG Description: 'true' if the underlay is enabled. +'false' if the underlay is disabled. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """enabled must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__enabled = t + if hasattr(self, '_set'): + self._set() + + def _unset_enabled(self): + self.__enabled = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + + def _get_primary_path(self): + """ + Getter method for primary_path, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path (container) + + YANG Description: The service path on the underlay topology that +supports this link. + """ + return self.__primary_path + + def _set_primary_path(self, v, load=False): + """ + Setter method for primary_path, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_primary_path is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_primary_path() directly. + + YANG Description: The service path on the underlay topology that +supports this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """primary_path must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__primary_path = t + if hasattr(self, '_set'): + self._set() + + def _unset_primary_path(self): + self.__primary_path = YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_backup_path(self): + """ + Getter method for backup_path, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path (list) + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + return self.__backup_path + + def _set_backup_path(self, v, load=False): + """ + Setter method for backup_path, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_backup_path is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_backup_path() directly. + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """backup_path must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__backup_path = t + if hasattr(self, '_set'): + self._set() + + def _unset_backup_path(self): + self.__backup_path = YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + + def _get_protection_type(self): + """ + Getter method for protection_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/protection_type (identityref) + + YANG Description: Underlay protection type desired for this link. + """ + return self.__protection_type + + def _set_protection_type(self, v, load=False): + """ + Setter method for protection_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/protection_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_protection_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_protection_type() directly. + + YANG Description: Underlay protection type desired for this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """protection_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__protection_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_protection_type(self): + self.__protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_tunnel_termination_points(self): + """ + Getter method for tunnel_termination_points, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnel_termination_points (container) + + YANG Description: Underlay TTPs desired for this link. + """ + return self.__tunnel_termination_points + + def _set_tunnel_termination_points(self, v, load=False): + """ + Setter method for tunnel_termination_points, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnel_termination_points (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel_termination_points is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel_termination_points() directly. + + YANG Description: Underlay TTPs desired for this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel_termination_points must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__tunnel_termination_points = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel_termination_points(self): + self.__tunnel_termination_points = YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_tunnels(self): + """ + Getter method for tunnels, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnels (container) + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + return self.__tunnels + + def _set_tunnels(self, v, load=False): + """ + Setter method for tunnels, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnels (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnels is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnels() directly. + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnels must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__tunnels = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnels(self): + self.__tunnels = YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + enabled = __builtin__.property(_get_enabled, _set_enabled) + primary_path = __builtin__.property(_get_primary_path, _set_primary_path) + backup_path = __builtin__.property(_get_backup_path, _set_backup_path) + protection_type = __builtin__.property(_get_protection_type, _set_protection_type) + tunnel_termination_points = __builtin__.property(_get_tunnel_termination_points, _set_tunnel_termination_points) + tunnels = __builtin__.property(_get_tunnels, _set_tunnels) + + + _pyangbind_elements = OrderedDict([('enabled', enabled), ('primary_path', primary_path), ('backup_path', backup_path), ('protection_type', protection_type), ('tunnel_termination_points', tunnel_termination_points), ('tunnels', tunnels), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/__init__.py new file mode 100644 index 000000000..4347a263e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/__init__.py @@ -0,0 +1,207 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_element +class backup_path(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/underlay/backup-path. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__network_ref','__path_element',) + + _yang_name = 'backup-path' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'underlay', 'backup-path'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/index (uint32) + + YANG Description: A sequence number to identify a backup path. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/index (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: A sequence number to identify a backup path. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + + def _get_path_element(self): + """ + Getter method for path_element, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element (list) + + YANG Description: A list of path elements describing the backup service +path. + """ + return self.__path_element + + def _set_path_element(self, v, load=False): + """ + Setter method for path_element, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element() directly. + + YANG Description: A list of path elements describing the backup service +path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_element = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element(self): + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + index = __builtin__.property(_get_index, _set_index) + network_ref = __builtin__.property(_get_network_ref, _set_network_ref) + path_element = __builtin__.property(_get_path_element, _set_path_element) + + + _pyangbind_elements = OrderedDict([('index', index), ('network_ref', network_ref), ('path_element', path_element), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/__init__.py new file mode 100644 index 000000000..274232036 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/__init__.py @@ -0,0 +1,321 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class path_element(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/underlay/backup-path/path-element. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of path elements describing the backup service +path. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_element_id','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'path-element' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'underlay', 'backup-path', 'path-element'] + + def _get_path_element_id(self): + """ + Getter method for path_element_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/path_element_id (uint32) + + YANG Description: To identify the element in a path. + """ + return self.__path_element_id + + def _set_path_element_id(self, v, load=False): + """ + Setter method for path_element_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/path_element_id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element_id() directly. + + YANG Description: To identify the element in a path. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element_id must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__path_element_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element_id(self): + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + path_element_id = __builtin__.property(_get_path_element_id, _set_path_element_id) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop, _set_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop, _set_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop, _set_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop, _set_as_number_hop) + label_hop = __builtin__.property(_get_label_hop, _set_label_hop) + + __choices__ = {'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('path_element_id', path_element_id), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/as_number_hop/__init__.py new file mode 100644 index 000000000..d2bba5863 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/underlay/backup-path/path-element/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'underlay', 'backup-path', 'path-element', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + as_number = __builtin__.property(_get_as_number, _set_as_number) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/__init__.py new file mode 100644 index 000000000..c46d30191 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/underlay/backup-path/path-element/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'underlay', 'backup-path', 'path-element', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label/__init__.py new file mode 100644 index 000000000..7a629f62c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/underlay/backup-path/path-element/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'underlay', 'backup-path', 'path-element', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py new file mode 100644 index 000000000..f372a5fb3 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/underlay/backup-path/path-element/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'underlay', 'backup-path', 'path-element', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + tsg = __builtin__.property(_get_tsg, _set_tsg) + ts_list = __builtin__.property(_get_ts_list, _set_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/numbered_link_hop/__init__.py new file mode 100644 index 000000000..4f7ede0ea --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/underlay/backup-path/path-element/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'underlay', 'backup-path', 'path-element', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/numbered_node_hop/__init__.py new file mode 100644 index 000000000..88dac6553 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/underlay/backup-path/path-element/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'underlay', 'backup-path', 'path-element', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/numbered_node_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py new file mode 100644 index 000000000..b5a3dfc51 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/underlay/backup-path/path-element/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'underlay', 'backup-path', 'path-element', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/unnumbered_link_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/backup_path/path_element/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/__init__.py new file mode 100644 index 000000000..bca7e6259 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/__init__.py @@ -0,0 +1,158 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_element +class primary_path(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/underlay/primary-path. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The service path on the underlay topology that +supports this link. + """ + __slots__ = ('_path_helper', '_extmethods', '__network_ref','__path_element',) + + _yang_name = 'primary-path' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'underlay', 'primary-path'] + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + + def _get_path_element(self): + """ + Getter method for path_element, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element (list) + + YANG Description: A list of path elements describing the service path. + """ + return self.__path_element + + def _set_path_element(self, v, load=False): + """ + Setter method for path_element, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element() directly. + + YANG Description: A list of path elements describing the service path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_element = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element(self): + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + network_ref = __builtin__.property(_get_network_ref, _set_network_ref) + path_element = __builtin__.property(_get_path_element, _set_path_element) + + + _pyangbind_elements = OrderedDict([('network_ref', network_ref), ('path_element', path_element), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/__init__.py new file mode 100644 index 000000000..2ae1b7cb8 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/__init__.py @@ -0,0 +1,320 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class path_element(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/underlay/primary-path/path-element. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of path elements describing the service path. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_element_id','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'path-element' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'underlay', 'primary-path', 'path-element'] + + def _get_path_element_id(self): + """ + Getter method for path_element_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/path_element_id (uint32) + + YANG Description: To identify the element in a path. + """ + return self.__path_element_id + + def _set_path_element_id(self, v, load=False): + """ + Setter method for path_element_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/path_element_id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element_id() directly. + + YANG Description: To identify the element in a path. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element_id must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__path_element_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element_id(self): + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + path_element_id = __builtin__.property(_get_path_element_id, _set_path_element_id) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop, _set_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop, _set_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop, _set_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop, _set_as_number_hop) + label_hop = __builtin__.property(_get_label_hop, _set_label_hop) + + __choices__ = {'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('path_element_id', path_element_id), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/as_number_hop/__init__.py new file mode 100644 index 000000000..68297031d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/underlay/primary-path/path-element/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'underlay', 'primary-path', 'path-element', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + as_number = __builtin__.property(_get_as_number, _set_as_number) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/__init__.py new file mode 100644 index 000000000..80afc929d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/underlay/primary-path/path-element/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'underlay', 'primary-path', 'path-element', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label/__init__.py new file mode 100644 index 000000000..51e80cb34 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/underlay/primary-path/path-element/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'underlay', 'primary-path', 'path-element', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py new file mode 100644 index 000000000..bc1e9a494 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/underlay/primary-path/path-element/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'underlay', 'primary-path', 'path-element', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + tsg = __builtin__.property(_get_tsg, _set_tsg) + ts_list = __builtin__.property(_get_ts_list, _set_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/numbered_link_hop/__init__.py new file mode 100644 index 000000000..94bf3ca84 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/underlay/primary-path/path-element/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'underlay', 'primary-path', 'path-element', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/numbered_node_hop/__init__.py new file mode 100644 index 000000000..3e3ac258c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/underlay/primary-path/path-element/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'underlay', 'primary-path', 'path-element', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/numbered_node_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py new file mode 100644 index 000000000..0a2138b5f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/underlay/primary-path/path-element/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'underlay', 'primary-path', 'path-element', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/unnumbered_link_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/primary_path/path_element/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnel_termination_points/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnel_termination_points/__init__.py new file mode 100644 index 000000000..018032a5f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnel_termination_points/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class tunnel_termination_points(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/underlay/tunnel-termination-points. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Underlay TTPs desired for this link. + """ + __slots__ = ('_path_helper', '_extmethods', '__source','__destination',) + + _yang_name = 'tunnel-termination-points' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__source = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + self.__destination = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'underlay', 'tunnel-termination-points'] + + def _get_source(self): + """ + Getter method for source, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnel_termination_points/source (binary) + + YANG Description: Source TTP identifier. + """ + return self.__source + + def _set_source(self, v, load=False): + """ + Setter method for source, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnel_termination_points/source (binary) + If this variable is read-only (config: false) in the + source YANG file, then _set_source is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_source() directly. + + YANG Description: Source TTP identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """source must be of a type compatible with binary""", + 'defined-type': "binary", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True)""", + }) + + self.__source = t + if hasattr(self, '_set'): + self._set() + + def _unset_source(self): + self.__source = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + + + def _get_destination(self): + """ + Getter method for destination, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnel_termination_points/destination (binary) + + YANG Description: Destination TTP identifier. + """ + return self.__destination + + def _set_destination(self, v, load=False): + """ + Setter method for destination, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnel_termination_points/destination (binary) + If this variable is read-only (config: false) in the + source YANG file, then _set_destination is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_destination() directly. + + YANG Description: Destination TTP identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """destination must be of a type compatible with binary""", + 'defined-type': "binary", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True)""", + }) + + self.__destination = t + if hasattr(self, '_set'): + self._set() + + def _unset_destination(self): + self.__destination = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + + source = __builtin__.property(_get_source, _set_source) + destination = __builtin__.property(_get_destination, _set_destination) + + + _pyangbind_elements = OrderedDict([('source', source), ('destination', destination), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnels/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnels/__init__.py new file mode 100644 index 000000000..2ba01ce03 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnels/__init__.py @@ -0,0 +1,167 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import tunnel +class tunnels(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/underlay/tunnels. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + __slots__ = ('_path_helper', '_extmethods', '__sharing','__tunnel',) + + _yang_name = 'tunnels' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__sharing = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + self.__tunnel = YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'underlay', 'tunnels'] + + def _get_sharing(self): + """ + Getter method for sharing, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnels/sharing (boolean) + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. +This leaf is the default option for all TE tunnels +and may be overridden by the per-TE-tunnel value. + """ + return self.__sharing + + def _set_sharing(self, v, load=False): + """ + Setter method for sharing, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnels/sharing (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_sharing is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_sharing() directly. + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. +This leaf is the default option for all TE tunnels +and may be overridden by the per-TE-tunnel value. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """sharing must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__sharing = t + if hasattr(self, '_set'): + self._set() + + def _unset_sharing(self): + self.__sharing = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + + def _get_tunnel(self): + """ + Getter method for tunnel, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnels/tunnel (list) + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + return self.__tunnel + + def _set_tunnel(self, v, load=False): + """ + Setter method for tunnel, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnels/tunnel (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel() directly. + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__tunnel = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel(self): + self.__tunnel = YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + sharing = __builtin__.property(_get_sharing, _set_sharing) + tunnel = __builtin__.property(_get_tunnel, _set_tunnel) + + + _pyangbind_elements = OrderedDict([('sharing', sharing), ('tunnel', tunnel), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnels/tunnel/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnels/tunnel/__init__.py new file mode 100644 index 000000000..ee3791127 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnels/tunnel/__init__.py @@ -0,0 +1,170 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class tunnel(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/local-link-connectivities/underlay/tunnels/tunnel. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + __slots__ = ('_path_helper', '_extmethods', '__tunnel_name','__sharing',) + + _yang_name = 'tunnel' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tunnel_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + self.__sharing = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'local-link-connectivities', 'underlay', 'tunnels', 'tunnel'] + + def _get_tunnel_name(self): + """ + Getter method for tunnel_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnels/tunnel/tunnel_name (string) + + YANG Description: A tunnel name uniquely identifies an underlay TE tunnel, +used together with the 'source-node' value for this +link. + """ + return self.__tunnel_name + + def _set_tunnel_name(self, v, load=False): + """ + Setter method for tunnel_name, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnels/tunnel/tunnel_name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel_name() directly. + + YANG Description: A tunnel name uniquely identifies an underlay TE tunnel, +used together with the 'source-node' value for this +link. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel_name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True)""", + }) + + self.__tunnel_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel_name(self): + self.__tunnel_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + + def _get_sharing(self): + """ + Getter method for sharing, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnels/tunnel/sharing (boolean) + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. + """ + return self.__sharing + + def _set_sharing(self, v, load=False): + """ + Setter method for sharing, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/local_link_connectivities/underlay/tunnels/tunnel/sharing (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_sharing is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_sharing() directly. + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """sharing must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__sharing = t + if hasattr(self, '_set'): + self._set() + + def _unset_sharing(self): + self.__sharing = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + tunnel_name = __builtin__.property(_get_tunnel_name, _set_tunnel_name) + sharing = __builtin__.property(_get_sharing, _set_sharing) + + + _pyangbind_elements = OrderedDict([('tunnel_name', tunnel_name), ('sharing', sharing), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/statistics/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/statistics/__init__.py new file mode 100644 index 000000000..f80379174 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/statistics/__init__.py @@ -0,0 +1,207 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import tunnel_termination_point +from . import local_link_connectivity +class statistics(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/statistics. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Statistics data. + """ + __slots__ = ('_path_helper', '_extmethods', '__discontinuity_time','__tunnel_termination_point','__local_link_connectivity',) + + _yang_name = 'statistics' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__discontinuity_time = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[\\+\\-]\\d{2}:\\d{2})'}), is_leaf=True, yang_name="discontinuity-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:date-and-time', is_config=False) + self.__tunnel_termination_point = YANGDynClass(base=tunnel_termination_point.tunnel_termination_point, is_container='container', yang_name="tunnel-termination-point", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__local_link_connectivity = YANGDynClass(base=local_link_connectivity.local_link_connectivity, is_container='container', yang_name="local-link-connectivity", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'statistics'] + + def _get_discontinuity_time(self): + """ + Getter method for discontinuity_time, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/discontinuity_time (yang:date-and-time) + + YANG Description: The time of the most recent occasion at which any one or +more of this interface's counters suffered a +discontinuity. If no such discontinuities have occurred +since the last re-initialization of the local management +subsystem, then this node contains the time the local +management subsystem re-initialized itself. + """ + return self.__discontinuity_time + + def _set_discontinuity_time(self, v, load=False): + """ + Setter method for discontinuity_time, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/discontinuity_time (yang:date-and-time) + If this variable is read-only (config: false) in the + source YANG file, then _set_discontinuity_time is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_discontinuity_time() directly. + + YANG Description: The time of the most recent occasion at which any one or +more of this interface's counters suffered a +discontinuity. If no such discontinuities have occurred +since the last re-initialization of the local management +subsystem, then this node contains the time the local +management subsystem re-initialized itself. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[\\+\\-]\\d{2}:\\d{2})'}), is_leaf=True, yang_name="discontinuity-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:date-and-time', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """discontinuity_time must be of a type compatible with yang:date-and-time""", + 'defined-type': "yang:date-and-time", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[\\+\\-]\\d{2}:\\d{2})'}), is_leaf=True, yang_name="discontinuity-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:date-and-time', is_config=False)""", + }) + + self.__discontinuity_time = t + if hasattr(self, '_set'): + self._set() + + def _unset_discontinuity_time(self): + self.__discontinuity_time = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[\\+\\-]\\d{2}:\\d{2})'}), is_leaf=True, yang_name="discontinuity-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:date-and-time', is_config=False) + + + def _get_tunnel_termination_point(self): + """ + Getter method for tunnel_termination_point, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point (container) + + YANG Description: Contains statistics attributes at the TE TTP level. + """ + return self.__tunnel_termination_point + + def _set_tunnel_termination_point(self, v, load=False): + """ + Setter method for tunnel_termination_point, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel_termination_point is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel_termination_point() directly. + + YANG Description: Contains statistics attributes at the TE TTP level. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tunnel_termination_point.tunnel_termination_point, is_container='container', yang_name="tunnel-termination-point", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel_termination_point must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tunnel_termination_point.tunnel_termination_point, is_container='container', yang_name="tunnel-termination-point", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__tunnel_termination_point = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel_termination_point(self): + self.__tunnel_termination_point = YANGDynClass(base=tunnel_termination_point.tunnel_termination_point, is_container='container', yang_name="tunnel-termination-point", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_local_link_connectivity(self): + """ + Getter method for local_link_connectivity, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/local_link_connectivity (container) + + YANG Description: Contains statistics attributes at the TE LLCL (Local Link +Connectivity List) level. + """ + return self.__local_link_connectivity + + def _set_local_link_connectivity(self, v, load=False): + """ + Setter method for local_link_connectivity, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/local_link_connectivity (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_local_link_connectivity is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_local_link_connectivity() directly. + + YANG Description: Contains statistics attributes at the TE LLCL (Local Link +Connectivity List) level. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=local_link_connectivity.local_link_connectivity, is_container='container', yang_name="local-link-connectivity", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """local_link_connectivity must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=local_link_connectivity.local_link_connectivity, is_container='container', yang_name="local-link-connectivity", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__local_link_connectivity = t + if hasattr(self, '_set'): + self._set() + + def _unset_local_link_connectivity(self): + self.__local_link_connectivity = YANGDynClass(base=local_link_connectivity.local_link_connectivity, is_container='container', yang_name="local-link-connectivity", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + discontinuity_time = __builtin__.property(_get_discontinuity_time) + tunnel_termination_point = __builtin__.property(_get_tunnel_termination_point) + local_link_connectivity = __builtin__.property(_get_local_link_connectivity) + + + _pyangbind_elements = OrderedDict([('discontinuity_time', discontinuity_time), ('tunnel_termination_point', tunnel_termination_point), ('local_link_connectivity', local_link_connectivity), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/statistics/local_link_connectivity/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/statistics/local_link_connectivity/__init__.py new file mode 100644 index 000000000..e533bc72d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/statistics/local_link_connectivity/__init__.py @@ -0,0 +1,272 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class local_link_connectivity(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/statistics/local-link-connectivity. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains statistics attributes at the TE LLCL (Local Link +Connectivity List) level. + """ + __slots__ = ('_path_helper', '_extmethods', '__creates','__deletes','__disables','__enables','__modifies',) + + _yang_name = 'local-link-connectivity' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__creates = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="creates", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__deletes = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="deletes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__disables = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="disables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__enables = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="enables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__modifies = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="modifies", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'statistics', 'local-link-connectivity'] + + def _get_creates(self): + """ + Getter method for creates, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/local_link_connectivity/creates (yang:counter32) + + YANG Description: Number of times that an LLCL entry was created. + """ + return self.__creates + + def _set_creates(self, v, load=False): + """ + Setter method for creates, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/local_link_connectivity/creates (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_creates is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_creates() directly. + + YANG Description: Number of times that an LLCL entry was created. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="creates", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """creates must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="creates", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__creates = t + if hasattr(self, '_set'): + self._set() + + def _unset_creates(self): + self.__creates = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="creates", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_deletes(self): + """ + Getter method for deletes, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/local_link_connectivity/deletes (yang:counter32) + + YANG Description: Number of times that an LLCL entry was deleted. + """ + return self.__deletes + + def _set_deletes(self, v, load=False): + """ + Setter method for deletes, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/local_link_connectivity/deletes (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_deletes is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_deletes() directly. + + YANG Description: Number of times that an LLCL entry was deleted. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="deletes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """deletes must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="deletes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__deletes = t + if hasattr(self, '_set'): + self._set() + + def _unset_deletes(self): + self.__deletes = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="deletes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_disables(self): + """ + Getter method for disables, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/local_link_connectivity/disables (yang:counter32) + + YANG Description: Number of times that an LLCL entry was disabled. + """ + return self.__disables + + def _set_disables(self, v, load=False): + """ + Setter method for disables, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/local_link_connectivity/disables (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_disables is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_disables() directly. + + YANG Description: Number of times that an LLCL entry was disabled. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="disables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """disables must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="disables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__disables = t + if hasattr(self, '_set'): + self._set() + + def _unset_disables(self): + self.__disables = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="disables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_enables(self): + """ + Getter method for enables, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/local_link_connectivity/enables (yang:counter32) + + YANG Description: Number of times that an LLCL entry was enabled. + """ + return self.__enables + + def _set_enables(self, v, load=False): + """ + Setter method for enables, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/local_link_connectivity/enables (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_enables is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_enables() directly. + + YANG Description: Number of times that an LLCL entry was enabled. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="enables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """enables must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="enables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__enables = t + if hasattr(self, '_set'): + self._set() + + def _unset_enables(self): + self.__enables = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="enables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_modifies(self): + """ + Getter method for modifies, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/local_link_connectivity/modifies (yang:counter32) + + YANG Description: Number of times that an LLCL entry was modified. + """ + return self.__modifies + + def _set_modifies(self, v, load=False): + """ + Setter method for modifies, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/local_link_connectivity/modifies (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_modifies is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_modifies() directly. + + YANG Description: Number of times that an LLCL entry was modified. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="modifies", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """modifies must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="modifies", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__modifies = t + if hasattr(self, '_set'): + self._set() + + def _unset_modifies(self): + self.__modifies = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="modifies", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + creates = __builtin__.property(_get_creates) + deletes = __builtin__.property(_get_deletes) + disables = __builtin__.property(_get_disables) + enables = __builtin__.property(_get_enables) + modifies = __builtin__.property(_get_modifies) + + + _pyangbind_elements = OrderedDict([('creates', creates), ('deletes', deletes), ('disables', disables), ('enables', enables), ('modifies', modifies), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/__init__.py new file mode 100644 index 000000000..7759e40dd --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/__init__.py @@ -0,0 +1,435 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class tunnel_termination_point(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/statistics/tunnel-termination-point. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains statistics attributes at the TE TTP level. + """ + __slots__ = ('_path_helper', '_extmethods', '__disables','__enables','__maintenance_clears','__maintenance_sets','__modifies','__downs','__ups','__in_service_clears','__in_service_sets',) + + _yang_name = 'tunnel-termination-point' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__disables = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="disables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__enables = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="enables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__maintenance_clears = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="maintenance-clears", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__maintenance_sets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="maintenance-sets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__modifies = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="modifies", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__downs = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="downs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__ups = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="ups", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__in_service_clears = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="in-service-clears", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + self.__in_service_sets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="in-service-sets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'statistics', 'tunnel-termination-point'] + + def _get_disables(self): + """ + Getter method for disables, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/disables (yang:counter32) + + YANG Description: Number of times that a TTP was disabled. + """ + return self.__disables + + def _set_disables(self, v, load=False): + """ + Setter method for disables, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/disables (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_disables is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_disables() directly. + + YANG Description: Number of times that a TTP was disabled. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="disables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """disables must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="disables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__disables = t + if hasattr(self, '_set'): + self._set() + + def _unset_disables(self): + self.__disables = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="disables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_enables(self): + """ + Getter method for enables, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/enables (yang:counter32) + + YANG Description: Number of times that a TTP was enabled. + """ + return self.__enables + + def _set_enables(self, v, load=False): + """ + Setter method for enables, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/enables (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_enables is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_enables() directly. + + YANG Description: Number of times that a TTP was enabled. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="enables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """enables must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="enables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__enables = t + if hasattr(self, '_set'): + self._set() + + def _unset_enables(self): + self.__enables = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="enables", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_maintenance_clears(self): + """ + Getter method for maintenance_clears, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/maintenance_clears (yang:counter32) + + YANG Description: Number of times that a TTP was taken out of maintenance. + """ + return self.__maintenance_clears + + def _set_maintenance_clears(self, v, load=False): + """ + Setter method for maintenance_clears, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/maintenance_clears (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_maintenance_clears is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_maintenance_clears() directly. + + YANG Description: Number of times that a TTP was taken out of maintenance. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="maintenance-clears", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """maintenance_clears must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="maintenance-clears", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__maintenance_clears = t + if hasattr(self, '_set'): + self._set() + + def _unset_maintenance_clears(self): + self.__maintenance_clears = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="maintenance-clears", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_maintenance_sets(self): + """ + Getter method for maintenance_sets, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/maintenance_sets (yang:counter32) + + YANG Description: Number of times that a TTP was put in maintenance. + """ + return self.__maintenance_sets + + def _set_maintenance_sets(self, v, load=False): + """ + Setter method for maintenance_sets, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/maintenance_sets (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_maintenance_sets is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_maintenance_sets() directly. + + YANG Description: Number of times that a TTP was put in maintenance. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="maintenance-sets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """maintenance_sets must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="maintenance-sets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__maintenance_sets = t + if hasattr(self, '_set'): + self._set() + + def _unset_maintenance_sets(self): + self.__maintenance_sets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="maintenance-sets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_modifies(self): + """ + Getter method for modifies, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/modifies (yang:counter32) + + YANG Description: Number of times that a TTP was modified. + """ + return self.__modifies + + def _set_modifies(self, v, load=False): + """ + Setter method for modifies, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/modifies (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_modifies is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_modifies() directly. + + YANG Description: Number of times that a TTP was modified. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="modifies", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """modifies must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="modifies", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__modifies = t + if hasattr(self, '_set'): + self._set() + + def _unset_modifies(self): + self.__modifies = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="modifies", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_downs(self): + """ + Getter method for downs, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/downs (yang:counter32) + + YANG Description: Number of times that a TTP was set to an operational state +of 'down'. + """ + return self.__downs + + def _set_downs(self, v, load=False): + """ + Setter method for downs, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/downs (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_downs is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_downs() directly. + + YANG Description: Number of times that a TTP was set to an operational state +of 'down'. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="downs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """downs must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="downs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__downs = t + if hasattr(self, '_set'): + self._set() + + def _unset_downs(self): + self.__downs = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="downs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_ups(self): + """ + Getter method for ups, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/ups (yang:counter32) + + YANG Description: Number of times that a TTP was set to an operational state +of 'up'. + """ + return self.__ups + + def _set_ups(self, v, load=False): + """ + Setter method for ups, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/ups (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_ups is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ups() directly. + + YANG Description: Number of times that a TTP was set to an operational state +of 'up'. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="ups", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ups must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="ups", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__ups = t + if hasattr(self, '_set'): + self._set() + + def _unset_ups(self): + self.__ups = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="ups", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_in_service_clears(self): + """ + Getter method for in_service_clears, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/in_service_clears (yang:counter32) + + YANG Description: Number of times that a TTP was taken out of service +(TE tunnel was released). + """ + return self.__in_service_clears + + def _set_in_service_clears(self, v, load=False): + """ + Setter method for in_service_clears, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/in_service_clears (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_in_service_clears is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_in_service_clears() directly. + + YANG Description: Number of times that a TTP was taken out of service +(TE tunnel was released). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="in-service-clears", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """in_service_clears must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="in-service-clears", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__in_service_clears = t + if hasattr(self, '_set'): + self._set() + + def _unset_in_service_clears(self): + self.__in_service_clears = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="in-service-clears", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + + def _get_in_service_sets(self): + """ + Getter method for in_service_sets, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/in_service_sets (yang:counter32) + + YANG Description: Number of times that a TTP was put in service by a TE +tunnel (TE tunnel was set up). + """ + return self.__in_service_sets + + def _set_in_service_sets(self, v, load=False): + """ + Setter method for in_service_sets, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/statistics/tunnel_termination_point/in_service_sets (yang:counter32) + If this variable is read-only (config: false) in the + source YANG file, then _set_in_service_sets is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_in_service_sets() directly. + + YANG Description: Number of times that a TTP was put in service by a TE +tunnel (TE tunnel was set up). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="in-service-sets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """in_service_sets must be of a type compatible with yang:counter32""", + 'defined-type': "yang:counter32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="in-service-sets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False)""", + }) + + self.__in_service_sets = t + if hasattr(self, '_set'): + self._set() + + def _unset_in_service_sets(self): + self.__in_service_sets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="in-service-sets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:counter32', is_config=False) + + disables = __builtin__.property(_get_disables) + enables = __builtin__.property(_get_enables) + maintenance_clears = __builtin__.property(_get_maintenance_clears) + maintenance_sets = __builtin__.property(_get_maintenance_sets) + modifies = __builtin__.property(_get_modifies) + downs = __builtin__.property(_get_downs) + ups = __builtin__.property(_get_ups) + in_service_clears = __builtin__.property(_get_in_service_clears) + in_service_sets = __builtin__.property(_get_in_service_sets) + + + _pyangbind_elements = OrderedDict([('disables', disables), ('enables', enables), ('maintenance_clears', maintenance_clears), ('maintenance_sets', maintenance_sets), ('modifies', modifies), ('downs', downs), ('ups', ups), ('in_service_clears', in_service_clears), ('in_service_sets', in_service_sets), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/supporting_tunnel_termination_point/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/supporting_tunnel_termination_point/__init__.py new file mode 100644 index 000000000..2d4ca8bff --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/te/tunnel_termination_point/supporting_tunnel_termination_point/__init__.py @@ -0,0 +1,172 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class supporting_tunnel_termination_point(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/te/tunnel-termination-point/supporting-tunnel-termination-point. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Identifies the TTPs on which this TTP depends. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_ref','__tunnel_tp_ref',) + + _yang_name = 'supporting-tunnel-termination-point' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="node-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:uri', is_config=True) + self.__tunnel_tp_ref = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="tunnel-tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'te', 'tunnel-termination-point', 'supporting-tunnel-termination-point'] + + def _get_node_ref(self): + """ + Getter method for node_ref, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/supporting_tunnel_termination_point/node_ref (inet:uri) + + YANG Description: This leaf identifies the node in which the supporting +TTP is present. +This node is either the supporting node or a node in +an underlay topology. + """ + return self.__node_ref + + def _set_node_ref(self, v, load=False): + """ + Setter method for node_ref, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/supporting_tunnel_termination_point/node_ref (inet:uri) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_ref() directly. + + YANG Description: This leaf identifies the node in which the supporting +TTP is present. +This node is either the supporting node or a node in +an underlay topology. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="node-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:uri', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_ref must be of a type compatible with inet:uri""", + 'defined-type': "inet:uri", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="node-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:uri', is_config=True)""", + }) + + self.__node_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_ref(self): + self.__node_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="node-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:uri', is_config=True) + + + def _get_tunnel_tp_ref(self): + """ + Getter method for tunnel_tp_ref, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/supporting_tunnel_termination_point/tunnel_tp_ref (binary) + + YANG Description: Reference to a TTP that is in either the supporting node +or a node in an underlay topology. + """ + return self.__tunnel_tp_ref + + def _set_tunnel_tp_ref(self, v, load=False): + """ + Setter method for tunnel_tp_ref, mapped from YANG variable /networks/network/node/te/tunnel_termination_point/supporting_tunnel_termination_point/tunnel_tp_ref (binary) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel_tp_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel_tp_ref() directly. + + YANG Description: Reference to a TTP that is in either the supporting node +or a node in an underlay topology. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="tunnel-tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel_tp_ref must be of a type compatible with binary""", + 'defined-type': "binary", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="tunnel-tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True)""", + }) + + self.__tunnel_tp_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel_tp_ref(self): + self.__tunnel_tp_ref = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="tunnel-tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + + node_ref = __builtin__.property(_get_node_ref, _set_node_ref) + tunnel_tp_ref = __builtin__.property(_get_tunnel_tp_ref, _set_tunnel_tp_ref) + + + _pyangbind_elements = OrderedDict([('node_ref', node_ref), ('tunnel_tp_ref', tunnel_tp_ref), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/__init__.py new file mode 100644 index 000000000..1665caff1 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/__init__.py @@ -0,0 +1,339 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import supporting_termination_point +from . import te +from . import eth_svc +from . import eth_link_tp +class termination_point(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A termination point can terminate a link. +Depending on the type of topology, a termination point +could, for example, refer to a port or an interface. + """ + __slots__ = ('_path_helper', '_extmethods', '__tp_id','__supporting_termination_point','__te_tp_id','__te','__eth_svc','__eth_link_tp',) + + _yang_name = 'termination-point' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tp_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tp-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='tp-id', is_config=True) + self.__supporting_termination_point = YANGDynClass(base=YANGListType("network_ref node_ref tp_ref",supporting_termination_point.supporting_termination_point, yang_name="supporting-termination-point", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='network-ref node-ref tp-ref', extensions=None), is_container='list', yang_name="supporting-termination-point", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='list', is_config=True) + self.__te_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="te-tp-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-tp-id', is_config=True) + self.__te = YANGDynClass(base=te.te, is_container='container', yang_name="te", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__eth_svc = YANGDynClass(base=eth_svc.eth_svc, is_container='container', yang_name="eth-svc", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + self.__eth_link_tp = YANGDynClass(base=eth_link_tp.eth_link_tp, is_container='container', yang_name="eth-link-tp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'termination-point'] + + def _get_tp_id(self): + """ + Getter method for tp_id, mapped from YANG variable /networks/network/node/termination_point/tp_id (tp-id) + + YANG Description: Termination point identifier. + """ + return self.__tp_id + + def _set_tp_id(self, v, load=False): + """ + Setter method for tp_id, mapped from YANG variable /networks/network/node/termination_point/tp_id (tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tp_id() directly. + + YANG Description: Termination point identifier. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="tp-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tp_id must be of a type compatible with tp-id""", + 'defined-type': "ietf-network-topology:tp-id", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tp-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='tp-id', is_config=True)""", + }) + + self.__tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_tp_id(self): + self.__tp_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tp-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='tp-id', is_config=True) + + + def _get_supporting_termination_point(self): + """ + Getter method for supporting_termination_point, mapped from YANG variable /networks/network/node/termination_point/supporting_termination_point (list) + + YANG Description: This list identifies any termination points on which a +given termination point depends or onto which it maps. +Those termination points will themselves be contained +in a supporting node. This dependency information can be +inferred from the dependencies between links. Therefore, +this item is not separately configurable. Hence, no +corresponding constraint needs to be articulated. +The corresponding information is simply provided by the +implementing system. + """ + return self.__supporting_termination_point + + def _set_supporting_termination_point(self, v, load=False): + """ + Setter method for supporting_termination_point, mapped from YANG variable /networks/network/node/termination_point/supporting_termination_point (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_supporting_termination_point is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_supporting_termination_point() directly. + + YANG Description: This list identifies any termination points on which a +given termination point depends or onto which it maps. +Those termination points will themselves be contained +in a supporting node. This dependency information can be +inferred from the dependencies between links. Therefore, +this item is not separately configurable. Hence, no +corresponding constraint needs to be articulated. +The corresponding information is simply provided by the +implementing system. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("network_ref node_ref tp_ref",supporting_termination_point.supporting_termination_point, yang_name="supporting-termination-point", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='network-ref node-ref tp-ref', extensions=None), is_container='list', yang_name="supporting-termination-point", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """supporting_termination_point must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("network_ref node_ref tp_ref",supporting_termination_point.supporting_termination_point, yang_name="supporting-termination-point", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='network-ref node-ref tp-ref', extensions=None), is_container='list', yang_name="supporting-termination-point", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='list', is_config=True)""", + }) + + self.__supporting_termination_point = t + if hasattr(self, '_set'): + self._set() + + def _unset_supporting_termination_point(self): + self.__supporting_termination_point = YANGDynClass(base=YANGListType("network_ref node_ref tp_ref",supporting_termination_point.supporting_termination_point, yang_name="supporting-termination-point", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='network-ref node-ref tp-ref', extensions=None), is_container='list', yang_name="supporting-termination-point", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='list', is_config=True) + + + def _get_te_tp_id(self): + """ + Getter method for te_tp_id, mapped from YANG variable /networks/network/node/termination_point/te_tp_id (te-types:te-tp-id) + + YANG Description: An identifier that uniquely identifies a TE termination +point. + """ + return self.__te_tp_id + + def _set_te_tp_id(self, v, load=False): + """ + Setter method for te_tp_id, mapped from YANG variable /networks/network/node/termination_point/te_tp_id (te-types:te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_tp_id() directly. + + YANG Description: An identifier that uniquely identifies a TE termination +point. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="te-tp-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_tp_id must be of a type compatible with te-types:te-tp-id""", + 'defined-type': "te-types:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="te-tp-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-tp-id', is_config=True)""", + }) + + self.__te_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_tp_id(self): + self.__te_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="te-tp-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-tp-id', is_config=True) + + + def _get_te(self): + """ + Getter method for te, mapped from YANG variable /networks/network/node/termination_point/te (container) + + YANG Description: Indicates TE support. + """ + return self.__te + + def _set_te(self, v, load=False): + """ + Setter method for te, mapped from YANG variable /networks/network/node/termination_point/te (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te() directly. + + YANG Description: Indicates TE support. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te.te, is_container='container', yang_name="te", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te.te, is_container='container', yang_name="te", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te = t + if hasattr(self, '_set'): + self._set() + + def _unset_te(self): + self.__te = YANGDynClass(base=te.te, is_container='container', yang_name="te", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_eth_svc(self): + """ + Getter method for eth_svc, mapped from YANG variable /networks/network/node/termination_point/eth_svc (container) + + YANG Description: ETH LTP Service attributes. + """ + return self.__eth_svc + + def _set_eth_svc(self, v, load=False): + """ + Setter method for eth_svc, mapped from YANG variable /networks/network/node/termination_point/eth_svc (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_svc is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_svc() directly. + + YANG Description: ETH LTP Service attributes. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=eth_svc.eth_svc, is_container='container', yang_name="eth-svc", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_svc must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=eth_svc.eth_svc, is_container='container', yang_name="eth-svc", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True)""", + }) + + self.__eth_svc = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_svc(self): + self.__eth_svc = YANGDynClass(base=eth_svc.eth_svc, is_container='container', yang_name="eth-svc", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + + def _get_eth_link_tp(self): + """ + Getter method for eth_link_tp, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp (container) + + YANG Description: Attributes of the Ethernet Link Termination Point (LTP). + """ + return self.__eth_link_tp + + def _set_eth_link_tp(self, v, load=False): + """ + Setter method for eth_link_tp, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_link_tp is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_link_tp() directly. + + YANG Description: Attributes of the Ethernet Link Termination Point (LTP). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=eth_link_tp.eth_link_tp, is_container='container', yang_name="eth-link-tp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_link_tp must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=eth_link_tp.eth_link_tp, is_container='container', yang_name="eth-link-tp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True)""", + }) + + self.__eth_link_tp = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_link_tp(self): + self.__eth_link_tp = YANGDynClass(base=eth_link_tp.eth_link_tp, is_container='container', yang_name="eth-link-tp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + tp_id = __builtin__.property(_get_tp_id, _set_tp_id) + supporting_termination_point = __builtin__.property(_get_supporting_termination_point, _set_supporting_termination_point) + te_tp_id = __builtin__.property(_get_te_tp_id, _set_te_tp_id) + te = __builtin__.property(_get_te, _set_te) + eth_svc = __builtin__.property(_get_eth_svc, _set_eth_svc) + eth_link_tp = __builtin__.property(_get_eth_link_tp, _set_eth_link_tp) + + + _pyangbind_elements = OrderedDict([('tp_id', tp_id), ('supporting_termination_point', supporting_termination_point), ('te_tp_id', te_tp_id), ('te', te), ('eth_svc', eth_svc), ('eth_link_tp', eth_link_tp), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_link_tp/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_link_tp/__init__.py new file mode 100644 index 000000000..d3de63b0f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_link_tp/__init__.py @@ -0,0 +1,315 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import ingress_egress_bandwidth_profile +from . import ingress_bandwidth_profile +from . import egress_bandwidth_profile +class eth_link_tp(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/eth-link-tp. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Attributes of the Ethernet Link Termination Point (LTP). + """ + __slots__ = ('_path_helper', '_extmethods', '__ltp_mac_address','__port_vlan_id','__maximum_frame_size','__ingress_egress_bandwidth_profile','__ingress_bandwidth_profile','__egress_bandwidth_profile',) + + _yang_name = 'eth-link-tp' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__ltp_mac_address = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="ltp-mac-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='yang:mac-address', is_config=True) + self.__port_vlan_id = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="port-vlan-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__maximum_frame_size = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['64 .. 65535']}), is_leaf=True, yang_name="maximum-frame-size", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True) + self.__ingress_egress_bandwidth_profile = YANGDynClass(base=ingress_egress_bandwidth_profile.ingress_egress_bandwidth_profile, is_container='container', yang_name="ingress-egress-bandwidth-profile", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + self.__ingress_bandwidth_profile = YANGDynClass(base=ingress_bandwidth_profile.ingress_bandwidth_profile, is_container='container', yang_name="ingress-bandwidth-profile", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + self.__egress_bandwidth_profile = YANGDynClass(base=egress_bandwidth_profile.egress_bandwidth_profile, is_container='container', yang_name="egress-bandwidth-profile", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'termination-point', 'eth-link-tp'] + + def _get_ltp_mac_address(self): + """ + Getter method for ltp_mac_address, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ltp_mac_address (yang:mac-address) + + YANG Description: The MAC address of the Ethernet LTP. + """ + return self.__ltp_mac_address + + def _set_ltp_mac_address(self, v, load=False): + """ + Setter method for ltp_mac_address, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ltp_mac_address (yang:mac-address) + If this variable is read-only (config: false) in the + source YANG file, then _set_ltp_mac_address is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ltp_mac_address() directly. + + YANG Description: The MAC address of the Ethernet LTP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="ltp-mac-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='yang:mac-address', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ltp_mac_address must be of a type compatible with yang:mac-address""", + 'defined-type': "yang:mac-address", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="ltp-mac-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='yang:mac-address', is_config=True)""", + }) + + self.__ltp_mac_address = t + if hasattr(self, '_set'): + self._set() + + def _unset_ltp_mac_address(self): + self.__ltp_mac_address = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="ltp-mac-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='yang:mac-address', is_config=True) + + + def _get_port_vlan_id(self): + """ + Getter method for port_vlan_id, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/port_vlan_id (etht-types:vlanid) + + YANG Description: The Port VLAN ID of the Ethernet LTP. + """ + return self.__port_vlan_id + + def _set_port_vlan_id(self, v, load=False): + """ + Setter method for port_vlan_id, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/port_vlan_id (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_port_vlan_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_port_vlan_id() directly. + + YANG Description: The Port VLAN ID of the Ethernet LTP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="port-vlan-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """port_vlan_id must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="port-vlan-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__port_vlan_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_port_vlan_id(self): + self.__port_vlan_id = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="port-vlan-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_maximum_frame_size(self): + """ + Getter method for maximum_frame_size, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/maximum_frame_size (uint16) + + YANG Description: Maximum frame size + """ + return self.__maximum_frame_size + + def _set_maximum_frame_size(self, v, load=False): + """ + Setter method for maximum_frame_size, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/maximum_frame_size (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_maximum_frame_size is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_maximum_frame_size() directly. + + YANG Description: Maximum frame size + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['64 .. 65535']}), is_leaf=True, yang_name="maximum-frame-size", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """maximum_frame_size must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['64 .. 65535']}), is_leaf=True, yang_name="maximum-frame-size", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True)""", + }) + + self.__maximum_frame_size = t + if hasattr(self, '_set'): + self._set() + + def _unset_maximum_frame_size(self): + self.__maximum_frame_size = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['64 .. 65535']}), is_leaf=True, yang_name="maximum-frame-size", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True) + + + def _get_ingress_egress_bandwidth_profile(self): + """ + Getter method for ingress_egress_bandwidth_profile, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_egress_bandwidth_profile (container) + + YANG Description: The bandwith profile used in the ingress and egress +direction. + """ + return self.__ingress_egress_bandwidth_profile + + def _set_ingress_egress_bandwidth_profile(self, v, load=False): + """ + Setter method for ingress_egress_bandwidth_profile, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_egress_bandwidth_profile (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_ingress_egress_bandwidth_profile is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ingress_egress_bandwidth_profile() directly. + + YANG Description: The bandwith profile used in the ingress and egress +direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=ingress_egress_bandwidth_profile.ingress_egress_bandwidth_profile, is_container='container', yang_name="ingress-egress-bandwidth-profile", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ingress_egress_bandwidth_profile must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=ingress_egress_bandwidth_profile.ingress_egress_bandwidth_profile, is_container='container', yang_name="ingress-egress-bandwidth-profile", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True)""", + }) + + self.__ingress_egress_bandwidth_profile = t + if hasattr(self, '_set'): + self._set() + + def _unset_ingress_egress_bandwidth_profile(self): + self.__ingress_egress_bandwidth_profile = YANGDynClass(base=ingress_egress_bandwidth_profile.ingress_egress_bandwidth_profile, is_container='container', yang_name="ingress-egress-bandwidth-profile", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + + def _get_ingress_bandwidth_profile(self): + """ + Getter method for ingress_bandwidth_profile, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_bandwidth_profile (container) + + YANG Description: The bandwidth profile used in the ingress direction. + """ + return self.__ingress_bandwidth_profile + + def _set_ingress_bandwidth_profile(self, v, load=False): + """ + Setter method for ingress_bandwidth_profile, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_bandwidth_profile (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_ingress_bandwidth_profile is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ingress_bandwidth_profile() directly. + + YANG Description: The bandwidth profile used in the ingress direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=ingress_bandwidth_profile.ingress_bandwidth_profile, is_container='container', yang_name="ingress-bandwidth-profile", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ingress_bandwidth_profile must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=ingress_bandwidth_profile.ingress_bandwidth_profile, is_container='container', yang_name="ingress-bandwidth-profile", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True)""", + }) + + self.__ingress_bandwidth_profile = t + if hasattr(self, '_set'): + self._set() + + def _unset_ingress_bandwidth_profile(self): + self.__ingress_bandwidth_profile = YANGDynClass(base=ingress_bandwidth_profile.ingress_bandwidth_profile, is_container='container', yang_name="ingress-bandwidth-profile", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + + def _get_egress_bandwidth_profile(self): + """ + Getter method for egress_bandwidth_profile, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/egress_bandwidth_profile (container) + + YANG Description: The bandwidth profile used in the egress direction. + """ + return self.__egress_bandwidth_profile + + def _set_egress_bandwidth_profile(self, v, load=False): + """ + Setter method for egress_bandwidth_profile, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/egress_bandwidth_profile (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_egress_bandwidth_profile is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_egress_bandwidth_profile() directly. + + YANG Description: The bandwidth profile used in the egress direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=egress_bandwidth_profile.egress_bandwidth_profile, is_container='container', yang_name="egress-bandwidth-profile", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """egress_bandwidth_profile must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=egress_bandwidth_profile.egress_bandwidth_profile, is_container='container', yang_name="egress-bandwidth-profile", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True)""", + }) + + self.__egress_bandwidth_profile = t + if hasattr(self, '_set'): + self._set() + + def _unset_egress_bandwidth_profile(self): + self.__egress_bandwidth_profile = YANGDynClass(base=egress_bandwidth_profile.egress_bandwidth_profile, is_container='container', yang_name="egress-bandwidth-profile", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + ltp_mac_address = __builtin__.property(_get_ltp_mac_address, _set_ltp_mac_address) + port_vlan_id = __builtin__.property(_get_port_vlan_id, _set_port_vlan_id) + maximum_frame_size = __builtin__.property(_get_maximum_frame_size, _set_maximum_frame_size) + ingress_egress_bandwidth_profile = __builtin__.property(_get_ingress_egress_bandwidth_profile, _set_ingress_egress_bandwidth_profile) + ingress_bandwidth_profile = __builtin__.property(_get_ingress_bandwidth_profile, _set_ingress_bandwidth_profile) + egress_bandwidth_profile = __builtin__.property(_get_egress_bandwidth_profile, _set_egress_bandwidth_profile) + + __choices__ = {'direction': {'symmetrical': ['ingress_egress_bandwidth_profile'], 'asymmetrical': ['ingress_bandwidth_profile', 'egress_bandwidth_profile']}} + _pyangbind_elements = OrderedDict([('ltp_mac_address', ltp_mac_address), ('port_vlan_id', port_vlan_id), ('maximum_frame_size', maximum_frame_size), ('ingress_egress_bandwidth_profile', ingress_egress_bandwidth_profile), ('ingress_bandwidth_profile', ingress_bandwidth_profile), ('egress_bandwidth_profile', egress_bandwidth_profile), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_link_tp/egress_bandwidth_profile/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_link_tp/egress_bandwidth_profile/__init__.py new file mode 100644 index 000000000..f617b9577 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_link_tp/egress_bandwidth_profile/__init__.py @@ -0,0 +1,355 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class egress_bandwidth_profile(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/eth-link-tp/egress-bandwidth-profile. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The bandwidth profile used in the egress direction. + """ + __slots__ = ('_path_helper', '_extmethods', '__bandwidth_profile_type','__CIR','__CBS','__EIR','__EBS','__color_aware','__coupling_flag',) + + _yang_name = 'egress-bandwidth-profile' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__bandwidth_profile_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="bandwidth-profile-type", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:bandwidth-profile-type', is_config=True) + self.__CIR = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="CIR", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + self.__CBS = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="CBS", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + self.__EIR = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="EIR", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + self.__EBS = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="EBS", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + self.__color_aware = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="color-aware", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + self.__coupling_flag = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="coupling-flag", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'termination-point', 'eth-link-tp', 'egress-bandwidth-profile'] + + def _get_bandwidth_profile_type(self): + """ + Getter method for bandwidth_profile_type, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/egress_bandwidth_profile/bandwidth_profile_type (etht-types:bandwidth-profile-type) + + YANG Description: The type of bandwidth profile. + """ + return self.__bandwidth_profile_type + + def _set_bandwidth_profile_type(self, v, load=False): + """ + Setter method for bandwidth_profile_type, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/egress_bandwidth_profile/bandwidth_profile_type (etht-types:bandwidth-profile-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_bandwidth_profile_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_bandwidth_profile_type() directly. + + YANG Description: The type of bandwidth profile. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="bandwidth-profile-type", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:bandwidth-profile-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """bandwidth_profile_type must be of a type compatible with etht-types:bandwidth-profile-type""", + 'defined-type': "etht-types:bandwidth-profile-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="bandwidth-profile-type", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:bandwidth-profile-type', is_config=True)""", + }) + + self.__bandwidth_profile_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_bandwidth_profile_type(self): + self.__bandwidth_profile_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="bandwidth-profile-type", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:bandwidth-profile-type', is_config=True) + + + def _get_CIR(self): + """ + Getter method for CIR, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/egress_bandwidth_profile/CIR (uint64) + + YANG Description: Committed Information Rate in Kbps + """ + return self.__CIR + + def _set_CIR(self, v, load=False): + """ + Setter method for CIR, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/egress_bandwidth_profile/CIR (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_CIR is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_CIR() directly. + + YANG Description: Committed Information Rate in Kbps + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="CIR", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """CIR must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="CIR", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__CIR = t + if hasattr(self, '_set'): + self._set() + + def _unset_CIR(self): + self.__CIR = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="CIR", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + + def _get_CBS(self): + """ + Getter method for CBS, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/egress_bandwidth_profile/CBS (uint64) + + YANG Description: Committed Burst Size in in KBytes + """ + return self.__CBS + + def _set_CBS(self, v, load=False): + """ + Setter method for CBS, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/egress_bandwidth_profile/CBS (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_CBS is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_CBS() directly. + + YANG Description: Committed Burst Size in in KBytes + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="CBS", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """CBS must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="CBS", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__CBS = t + if hasattr(self, '_set'): + self._set() + + def _unset_CBS(self): + self.__CBS = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="CBS", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + + def _get_EIR(self): + """ + Getter method for EIR, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/egress_bandwidth_profile/EIR (uint64) + + YANG Description: Excess Information Rate in Kbps +In case of RFC 2698, PIR = CIR + EIR + """ + return self.__EIR + + def _set_EIR(self, v, load=False): + """ + Setter method for EIR, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/egress_bandwidth_profile/EIR (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_EIR is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_EIR() directly. + + YANG Description: Excess Information Rate in Kbps +In case of RFC 2698, PIR = CIR + EIR + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="EIR", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """EIR must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="EIR", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__EIR = t + if hasattr(self, '_set'): + self._set() + + def _unset_EIR(self): + self.__EIR = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="EIR", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + + def _get_EBS(self): + """ + Getter method for EBS, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/egress_bandwidth_profile/EBS (uint64) + + YANG Description: Excess Burst Size in KBytes. + In case of RFC 2698, PBS = CBS + EBS + """ + return self.__EBS + + def _set_EBS(self, v, load=False): + """ + Setter method for EBS, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/egress_bandwidth_profile/EBS (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_EBS is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_EBS() directly. + + YANG Description: Excess Burst Size in KBytes. + In case of RFC 2698, PBS = CBS + EBS + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="EBS", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """EBS must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="EBS", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__EBS = t + if hasattr(self, '_set'): + self._set() + + def _unset_EBS(self): + self.__EBS = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="EBS", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + + def _get_color_aware(self): + """ + Getter method for color_aware, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/egress_bandwidth_profile/color_aware (boolean) + + YANG Description: Indicates weather the color-mode is +color-aware or color-blind. + """ + return self.__color_aware + + def _set_color_aware(self, v, load=False): + """ + Setter method for color_aware, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/egress_bandwidth_profile/color_aware (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_color_aware is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_color_aware() directly. + + YANG Description: Indicates weather the color-mode is +color-aware or color-blind. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="color-aware", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """color_aware must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="color-aware", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__color_aware = t + if hasattr(self, '_set'): + self._set() + + def _unset_color_aware(self): + self.__color_aware = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="color-aware", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + + + def _get_coupling_flag(self): + """ + Getter method for coupling_flag, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/egress_bandwidth_profile/coupling_flag (boolean) + + YANG Description: Coupling Flag. + """ + return self.__coupling_flag + + def _set_coupling_flag(self, v, load=False): + """ + Setter method for coupling_flag, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/egress_bandwidth_profile/coupling_flag (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_coupling_flag is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_coupling_flag() directly. + + YANG Description: Coupling Flag. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="coupling-flag", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """coupling_flag must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="coupling-flag", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__coupling_flag = t + if hasattr(self, '_set'): + self._set() + + def _unset_coupling_flag(self): + self.__coupling_flag = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="coupling-flag", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + + bandwidth_profile_type = __builtin__.property(_get_bandwidth_profile_type, _set_bandwidth_profile_type) + CIR = __builtin__.property(_get_CIR, _set_CIR) + CBS = __builtin__.property(_get_CBS, _set_CBS) + EIR = __builtin__.property(_get_EIR, _set_EIR) + EBS = __builtin__.property(_get_EBS, _set_EBS) + color_aware = __builtin__.property(_get_color_aware, _set_color_aware) + coupling_flag = __builtin__.property(_get_coupling_flag, _set_coupling_flag) + + __choices__ = {'direction': {'asymmetrical': ['bandwidth_profile_type', 'CIR', 'CBS', 'EIR', 'EBS', 'color_aware', 'coupling_flag']}} + _pyangbind_elements = OrderedDict([('bandwidth_profile_type', bandwidth_profile_type), ('CIR', CIR), ('CBS', CBS), ('EIR', EIR), ('EBS', EBS), ('color_aware', color_aware), ('coupling_flag', coupling_flag), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_link_tp/ingress_bandwidth_profile/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_link_tp/ingress_bandwidth_profile/__init__.py new file mode 100644 index 000000000..a3ec08716 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_link_tp/ingress_bandwidth_profile/__init__.py @@ -0,0 +1,355 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class ingress_bandwidth_profile(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/eth-link-tp/ingress-bandwidth-profile. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The bandwidth profile used in the ingress direction. + """ + __slots__ = ('_path_helper', '_extmethods', '__bandwidth_profile_type','__CIR','__CBS','__EIR','__EBS','__color_aware','__coupling_flag',) + + _yang_name = 'ingress-bandwidth-profile' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__bandwidth_profile_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="bandwidth-profile-type", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:bandwidth-profile-type', is_config=True) + self.__CIR = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="CIR", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + self.__CBS = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="CBS", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + self.__EIR = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="EIR", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + self.__EBS = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="EBS", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + self.__color_aware = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="color-aware", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + self.__coupling_flag = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="coupling-flag", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'termination-point', 'eth-link-tp', 'ingress-bandwidth-profile'] + + def _get_bandwidth_profile_type(self): + """ + Getter method for bandwidth_profile_type, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_bandwidth_profile/bandwidth_profile_type (etht-types:bandwidth-profile-type) + + YANG Description: The type of bandwidth profile. + """ + return self.__bandwidth_profile_type + + def _set_bandwidth_profile_type(self, v, load=False): + """ + Setter method for bandwidth_profile_type, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_bandwidth_profile/bandwidth_profile_type (etht-types:bandwidth-profile-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_bandwidth_profile_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_bandwidth_profile_type() directly. + + YANG Description: The type of bandwidth profile. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="bandwidth-profile-type", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:bandwidth-profile-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """bandwidth_profile_type must be of a type compatible with etht-types:bandwidth-profile-type""", + 'defined-type': "etht-types:bandwidth-profile-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="bandwidth-profile-type", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:bandwidth-profile-type', is_config=True)""", + }) + + self.__bandwidth_profile_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_bandwidth_profile_type(self): + self.__bandwidth_profile_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="bandwidth-profile-type", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:bandwidth-profile-type', is_config=True) + + + def _get_CIR(self): + """ + Getter method for CIR, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_bandwidth_profile/CIR (uint64) + + YANG Description: Committed Information Rate in Kbps + """ + return self.__CIR + + def _set_CIR(self, v, load=False): + """ + Setter method for CIR, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_bandwidth_profile/CIR (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_CIR is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_CIR() directly. + + YANG Description: Committed Information Rate in Kbps + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="CIR", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """CIR must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="CIR", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__CIR = t + if hasattr(self, '_set'): + self._set() + + def _unset_CIR(self): + self.__CIR = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="CIR", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + + def _get_CBS(self): + """ + Getter method for CBS, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_bandwidth_profile/CBS (uint64) + + YANG Description: Committed Burst Size in in KBytes + """ + return self.__CBS + + def _set_CBS(self, v, load=False): + """ + Setter method for CBS, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_bandwidth_profile/CBS (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_CBS is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_CBS() directly. + + YANG Description: Committed Burst Size in in KBytes + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="CBS", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """CBS must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="CBS", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__CBS = t + if hasattr(self, '_set'): + self._set() + + def _unset_CBS(self): + self.__CBS = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="CBS", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + + def _get_EIR(self): + """ + Getter method for EIR, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_bandwidth_profile/EIR (uint64) + + YANG Description: Excess Information Rate in Kbps +In case of RFC 2698, PIR = CIR + EIR + """ + return self.__EIR + + def _set_EIR(self, v, load=False): + """ + Setter method for EIR, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_bandwidth_profile/EIR (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_EIR is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_EIR() directly. + + YANG Description: Excess Information Rate in Kbps +In case of RFC 2698, PIR = CIR + EIR + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="EIR", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """EIR must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="EIR", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__EIR = t + if hasattr(self, '_set'): + self._set() + + def _unset_EIR(self): + self.__EIR = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="EIR", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + + def _get_EBS(self): + """ + Getter method for EBS, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_bandwidth_profile/EBS (uint64) + + YANG Description: Excess Burst Size in KBytes. + In case of RFC 2698, PBS = CBS + EBS + """ + return self.__EBS + + def _set_EBS(self, v, load=False): + """ + Setter method for EBS, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_bandwidth_profile/EBS (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_EBS is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_EBS() directly. + + YANG Description: Excess Burst Size in KBytes. + In case of RFC 2698, PBS = CBS + EBS + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="EBS", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """EBS must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="EBS", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__EBS = t + if hasattr(self, '_set'): + self._set() + + def _unset_EBS(self): + self.__EBS = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="EBS", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + + def _get_color_aware(self): + """ + Getter method for color_aware, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_bandwidth_profile/color_aware (boolean) + + YANG Description: Indicates weather the color-mode is +color-aware or color-blind. + """ + return self.__color_aware + + def _set_color_aware(self, v, load=False): + """ + Setter method for color_aware, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_bandwidth_profile/color_aware (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_color_aware is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_color_aware() directly. + + YANG Description: Indicates weather the color-mode is +color-aware or color-blind. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="color-aware", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """color_aware must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="color-aware", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__color_aware = t + if hasattr(self, '_set'): + self._set() + + def _unset_color_aware(self): + self.__color_aware = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="color-aware", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + + + def _get_coupling_flag(self): + """ + Getter method for coupling_flag, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_bandwidth_profile/coupling_flag (boolean) + + YANG Description: Coupling Flag. + """ + return self.__coupling_flag + + def _set_coupling_flag(self, v, load=False): + """ + Setter method for coupling_flag, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_bandwidth_profile/coupling_flag (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_coupling_flag is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_coupling_flag() directly. + + YANG Description: Coupling Flag. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="coupling-flag", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """coupling_flag must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="coupling-flag", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__coupling_flag = t + if hasattr(self, '_set'): + self._set() + + def _unset_coupling_flag(self): + self.__coupling_flag = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="coupling-flag", parent=self, choice=('direction', 'asymmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + + bandwidth_profile_type = __builtin__.property(_get_bandwidth_profile_type, _set_bandwidth_profile_type) + CIR = __builtin__.property(_get_CIR, _set_CIR) + CBS = __builtin__.property(_get_CBS, _set_CBS) + EIR = __builtin__.property(_get_EIR, _set_EIR) + EBS = __builtin__.property(_get_EBS, _set_EBS) + color_aware = __builtin__.property(_get_color_aware, _set_color_aware) + coupling_flag = __builtin__.property(_get_coupling_flag, _set_coupling_flag) + + __choices__ = {'direction': {'asymmetrical': ['bandwidth_profile_type', 'CIR', 'CBS', 'EIR', 'EBS', 'color_aware', 'coupling_flag']}} + _pyangbind_elements = OrderedDict([('bandwidth_profile_type', bandwidth_profile_type), ('CIR', CIR), ('CBS', CBS), ('EIR', EIR), ('EBS', EBS), ('color_aware', color_aware), ('coupling_flag', coupling_flag), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_link_tp/ingress_egress_bandwidth_profile/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_link_tp/ingress_egress_bandwidth_profile/__init__.py new file mode 100644 index 000000000..87d611cce --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_link_tp/ingress_egress_bandwidth_profile/__init__.py @@ -0,0 +1,356 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class ingress_egress_bandwidth_profile(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/eth-link-tp/ingress-egress-bandwidth-profile. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The bandwith profile used in the ingress and egress +direction. + """ + __slots__ = ('_path_helper', '_extmethods', '__bandwidth_profile_type','__CIR','__CBS','__EIR','__EBS','__color_aware','__coupling_flag',) + + _yang_name = 'ingress-egress-bandwidth-profile' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__bandwidth_profile_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="bandwidth-profile-type", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:bandwidth-profile-type', is_config=True) + self.__CIR = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="CIR", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + self.__CBS = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="CBS", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + self.__EIR = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="EIR", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + self.__EBS = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="EBS", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + self.__color_aware = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="color-aware", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + self.__coupling_flag = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="coupling-flag", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'termination-point', 'eth-link-tp', 'ingress-egress-bandwidth-profile'] + + def _get_bandwidth_profile_type(self): + """ + Getter method for bandwidth_profile_type, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_egress_bandwidth_profile/bandwidth_profile_type (etht-types:bandwidth-profile-type) + + YANG Description: The type of bandwidth profile. + """ + return self.__bandwidth_profile_type + + def _set_bandwidth_profile_type(self, v, load=False): + """ + Setter method for bandwidth_profile_type, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_egress_bandwidth_profile/bandwidth_profile_type (etht-types:bandwidth-profile-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_bandwidth_profile_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_bandwidth_profile_type() directly. + + YANG Description: The type of bandwidth profile. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="bandwidth-profile-type", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:bandwidth-profile-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """bandwidth_profile_type must be of a type compatible with etht-types:bandwidth-profile-type""", + 'defined-type': "etht-types:bandwidth-profile-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="bandwidth-profile-type", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:bandwidth-profile-type', is_config=True)""", + }) + + self.__bandwidth_profile_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_bandwidth_profile_type(self): + self.__bandwidth_profile_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:mef-10-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2697-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-2698-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:rfc-4115-bwp': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="bandwidth-profile-type", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:bandwidth-profile-type', is_config=True) + + + def _get_CIR(self): + """ + Getter method for CIR, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_egress_bandwidth_profile/CIR (uint64) + + YANG Description: Committed Information Rate in Kbps + """ + return self.__CIR + + def _set_CIR(self, v, load=False): + """ + Setter method for CIR, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_egress_bandwidth_profile/CIR (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_CIR is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_CIR() directly. + + YANG Description: Committed Information Rate in Kbps + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="CIR", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """CIR must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="CIR", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__CIR = t + if hasattr(self, '_set'): + self._set() + + def _unset_CIR(self): + self.__CIR = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="CIR", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + + def _get_CBS(self): + """ + Getter method for CBS, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_egress_bandwidth_profile/CBS (uint64) + + YANG Description: Committed Burst Size in in KBytes + """ + return self.__CBS + + def _set_CBS(self, v, load=False): + """ + Setter method for CBS, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_egress_bandwidth_profile/CBS (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_CBS is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_CBS() directly. + + YANG Description: Committed Burst Size in in KBytes + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="CBS", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """CBS must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="CBS", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__CBS = t + if hasattr(self, '_set'): + self._set() + + def _unset_CBS(self): + self.__CBS = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="CBS", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + + def _get_EIR(self): + """ + Getter method for EIR, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_egress_bandwidth_profile/EIR (uint64) + + YANG Description: Excess Information Rate in Kbps +In case of RFC 2698, PIR = CIR + EIR + """ + return self.__EIR + + def _set_EIR(self, v, load=False): + """ + Setter method for EIR, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_egress_bandwidth_profile/EIR (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_EIR is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_EIR() directly. + + YANG Description: Excess Information Rate in Kbps +In case of RFC 2698, PIR = CIR + EIR + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="EIR", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """EIR must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="EIR", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__EIR = t + if hasattr(self, '_set'): + self._set() + + def _unset_EIR(self): + self.__EIR = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="EIR", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + + def _get_EBS(self): + """ + Getter method for EBS, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_egress_bandwidth_profile/EBS (uint64) + + YANG Description: Excess Burst Size in KBytes. + In case of RFC 2698, PBS = CBS + EBS + """ + return self.__EBS + + def _set_EBS(self, v, load=False): + """ + Setter method for EBS, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_egress_bandwidth_profile/EBS (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_EBS is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_EBS() directly. + + YANG Description: Excess Burst Size in KBytes. + In case of RFC 2698, PBS = CBS + EBS + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="EBS", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """EBS must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="EBS", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__EBS = t + if hasattr(self, '_set'): + self._set() + + def _unset_EBS(self): + self.__EBS = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="EBS", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + + def _get_color_aware(self): + """ + Getter method for color_aware, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_egress_bandwidth_profile/color_aware (boolean) + + YANG Description: Indicates weather the color-mode is +color-aware or color-blind. + """ + return self.__color_aware + + def _set_color_aware(self, v, load=False): + """ + Setter method for color_aware, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_egress_bandwidth_profile/color_aware (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_color_aware is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_color_aware() directly. + + YANG Description: Indicates weather the color-mode is +color-aware or color-blind. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="color-aware", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """color_aware must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="color-aware", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__color_aware = t + if hasattr(self, '_set'): + self._set() + + def _unset_color_aware(self): + self.__color_aware = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="color-aware", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + + + def _get_coupling_flag(self): + """ + Getter method for coupling_flag, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_egress_bandwidth_profile/coupling_flag (boolean) + + YANG Description: Coupling Flag. + """ + return self.__coupling_flag + + def _set_coupling_flag(self, v, load=False): + """ + Setter method for coupling_flag, mapped from YANG variable /networks/network/node/termination_point/eth_link_tp/ingress_egress_bandwidth_profile/coupling_flag (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_coupling_flag is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_coupling_flag() directly. + + YANG Description: Coupling Flag. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="coupling-flag", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """coupling_flag must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="coupling-flag", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__coupling_flag = t + if hasattr(self, '_set'): + self._set() + + def _unset_coupling_flag(self): + self.__coupling_flag = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="coupling-flag", parent=self, choice=('direction', 'symmetrical'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + + bandwidth_profile_type = __builtin__.property(_get_bandwidth_profile_type, _set_bandwidth_profile_type) + CIR = __builtin__.property(_get_CIR, _set_CIR) + CBS = __builtin__.property(_get_CBS, _set_CBS) + EIR = __builtin__.property(_get_EIR, _set_EIR) + EBS = __builtin__.property(_get_EBS, _set_EBS) + color_aware = __builtin__.property(_get_color_aware, _set_color_aware) + coupling_flag = __builtin__.property(_get_coupling_flag, _set_coupling_flag) + + __choices__ = {'direction': {'symmetrical': ['bandwidth_profile_type', 'CIR', 'CBS', 'EIR', 'EBS', 'color_aware', 'coupling_flag']}} + _pyangbind_elements = OrderedDict([('bandwidth_profile_type', bandwidth_profile_type), ('CIR', CIR), ('CBS', CBS), ('EIR', EIR), ('EBS', EBS), ('color_aware', color_aware), ('coupling_flag', coupling_flag), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/__init__.py new file mode 100644 index 000000000..940aa4ef9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/__init__.py @@ -0,0 +1,158 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import supported_classification +from . import supported_vlan_operations +class eth_svc(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/eth-svc. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: ETH LTP Service attributes. + """ + __slots__ = ('_path_helper', '_extmethods', '__supported_classification','__supported_vlan_operations',) + + _yang_name = 'eth-svc' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__supported_classification = YANGDynClass(base=supported_classification.supported_classification, is_container='container', yang_name="supported-classification", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + self.__supported_vlan_operations = YANGDynClass(base=supported_vlan_operations.supported_vlan_operations, is_container='container', yang_name="supported-vlan-operations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'termination-point', 'eth-svc'] + + def _get_supported_classification(self): + """ + Getter method for supported_classification, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification (container) + + YANG Description: Service classification capability supported by the +Ethernet Link Termination Point (LTP). + """ + return self.__supported_classification + + def _set_supported_classification(self, v, load=False): + """ + Setter method for supported_classification, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_supported_classification is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_supported_classification() directly. + + YANG Description: Service classification capability supported by the +Ethernet Link Termination Point (LTP). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=supported_classification.supported_classification, is_container='container', yang_name="supported-classification", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """supported_classification must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=supported_classification.supported_classification, is_container='container', yang_name="supported-classification", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True)""", + }) + + self.__supported_classification = t + if hasattr(self, '_set'): + self._set() + + def _unset_supported_classification(self): + self.__supported_classification = YANGDynClass(base=supported_classification.supported_classification, is_container='container', yang_name="supported-classification", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + + def _get_supported_vlan_operations(self): + """ + Getter method for supported_vlan_operations, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations (container) + + YANG Description: Reports the VLAN operations supported by the ETH LTP. + """ + return self.__supported_vlan_operations + + def _set_supported_vlan_operations(self, v, load=False): + """ + Setter method for supported_vlan_operations, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_supported_vlan_operations is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_supported_vlan_operations() directly. + + YANG Description: Reports the VLAN operations supported by the ETH LTP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=supported_vlan_operations.supported_vlan_operations, is_container='container', yang_name="supported-vlan-operations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """supported_vlan_operations must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=supported_vlan_operations.supported_vlan_operations, is_container='container', yang_name="supported-vlan-operations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True)""", + }) + + self.__supported_vlan_operations = t + if hasattr(self, '_set'): + self._set() + + def _unset_supported_vlan_operations(self): + self.__supported_vlan_operations = YANGDynClass(base=supported_vlan_operations.supported_vlan_operations, is_container='container', yang_name="supported-vlan-operations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + supported_classification = __builtin__.property(_get_supported_classification, _set_supported_classification) + supported_vlan_operations = __builtin__.property(_get_supported_vlan_operations, _set_supported_vlan_operations) + + + _pyangbind_elements = OrderedDict([('supported_classification', supported_classification), ('supported_vlan_operations', supported_vlan_operations), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_classification/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_classification/__init__.py new file mode 100644 index 000000000..5a244125d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_classification/__init__.py @@ -0,0 +1,160 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import vlan_classification +class supported_classification(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/eth-svc/supported-classification. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Service classification capability supported by the +Ethernet Link Termination Point (LTP). + """ + __slots__ = ('_path_helper', '_extmethods', '__port_classification','__vlan_classification',) + + _yang_name = 'supported-classification' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__port_classification = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="port-classification", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + self.__vlan_classification = YANGDynClass(base=vlan_classification.vlan_classification, is_container='container', yang_name="vlan-classification", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'termination-point', 'eth-svc', 'supported-classification'] + + def _get_port_classification(self): + """ + Getter method for port_classification, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/port_classification (boolean) + + YANG Description: Indicates that the ETH LTP support port-based service +classification. + """ + return self.__port_classification + + def _set_port_classification(self, v, load=False): + """ + Setter method for port_classification, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/port_classification (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_port_classification is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_port_classification() directly. + + YANG Description: Indicates that the ETH LTP support port-based service +classification. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="port-classification", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """port_classification must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="port-classification", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__port_classification = t + if hasattr(self, '_set'): + self._set() + + def _unset_port_classification(self): + self.__port_classification = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="port-classification", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + + + def _get_vlan_classification(self): + """ + Getter method for vlan_classification, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification (container) + + YANG Description: Service classification capabilities based on the VLAN +tag(s) supported by the ETH LTP. + """ + return self.__vlan_classification + + def _set_vlan_classification(self, v, load=False): + """ + Setter method for vlan_classification, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlan_classification is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlan_classification() directly. + + YANG Description: Service classification capabilities based on the VLAN +tag(s) supported by the ETH LTP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=vlan_classification.vlan_classification, is_container='container', yang_name="vlan-classification", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlan_classification must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=vlan_classification.vlan_classification, is_container='container', yang_name="vlan-classification", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True)""", + }) + + self.__vlan_classification = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlan_classification(self): + self.__vlan_classification = YANGDynClass(base=vlan_classification.vlan_classification, is_container='container', yang_name="vlan-classification", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + port_classification = __builtin__.property(_get_port_classification, _set_port_classification) + vlan_classification = __builtin__.property(_get_vlan_classification, _set_vlan_classification) + + + _pyangbind_elements = OrderedDict([('port_classification', port_classification), ('vlan_classification', vlan_classification), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/__init__.py new file mode 100644 index 000000000..fa8bc5167 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/__init__.py @@ -0,0 +1,202 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import outer_tag +from . import second_tag +class vlan_classification(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/eth-svc/supported-classification/vlan-classification. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Service classification capabilities based on the VLAN +tag(s) supported by the ETH LTP. + """ + __slots__ = ('_path_helper', '_extmethods', '__vlan_tag_classification','__outer_tag','__second_tag',) + + _yang_name = 'vlan-classification' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__vlan_tag_classification = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="vlan-tag-classification", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + self.__outer_tag = YANGDynClass(base=outer_tag.outer_tag, is_container='container', yang_name="outer-tag", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + self.__second_tag = YANGDynClass(base=second_tag.second_tag, is_container='container', yang_name="second-tag", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'termination-point', 'eth-svc', 'supported-classification', 'vlan-classification'] + + def _get_vlan_tag_classification(self): + """ + Getter method for vlan_tag_classification, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/vlan_tag_classification (boolean) + + YANG Description: Indicates that the ETH LTP supports VLAN service +classification. + """ + return self.__vlan_tag_classification + + def _set_vlan_tag_classification(self, v, load=False): + """ + Setter method for vlan_tag_classification, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/vlan_tag_classification (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlan_tag_classification is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlan_tag_classification() directly. + + YANG Description: Indicates that the ETH LTP supports VLAN service +classification. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="vlan-tag-classification", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlan_tag_classification must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="vlan-tag-classification", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__vlan_tag_classification = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlan_tag_classification(self): + self.__vlan_tag_classification = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="vlan-tag-classification", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + + + def _get_outer_tag(self): + """ + Getter method for outer_tag, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/outer_tag (container) + + YANG Description: Service classification capabilities based on the outer +VLAN tag, supported by the ETH LTP. + """ + return self.__outer_tag + + def _set_outer_tag(self, v, load=False): + """ + Setter method for outer_tag, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/outer_tag (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_outer_tag is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_outer_tag() directly. + + YANG Description: Service classification capabilities based on the outer +VLAN tag, supported by the ETH LTP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=outer_tag.outer_tag, is_container='container', yang_name="outer-tag", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """outer_tag must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=outer_tag.outer_tag, is_container='container', yang_name="outer-tag", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True)""", + }) + + self.__outer_tag = t + if hasattr(self, '_set'): + self._set() + + def _unset_outer_tag(self): + self.__outer_tag = YANGDynClass(base=outer_tag.outer_tag, is_container='container', yang_name="outer-tag", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + + def _get_second_tag(self): + """ + Getter method for second_tag, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/second_tag (container) + + YANG Description: Service classification capabilities based on the second +VLAN tag, supported by the ETH LTP. + """ + return self.__second_tag + + def _set_second_tag(self, v, load=False): + """ + Setter method for second_tag, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/second_tag (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_second_tag is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_second_tag() directly. + + YANG Description: Service classification capabilities based on the second +VLAN tag, supported by the ETH LTP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=second_tag.second_tag, is_container='container', yang_name="second-tag", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """second_tag must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=second_tag.second_tag, is_container='container', yang_name="second-tag", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True)""", + }) + + self.__second_tag = t + if hasattr(self, '_set'): + self._set() + + def _unset_second_tag(self): + self.__second_tag = YANGDynClass(base=second_tag.second_tag, is_container='container', yang_name="second-tag", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + vlan_tag_classification = __builtin__.property(_get_vlan_tag_classification, _set_vlan_tag_classification) + outer_tag = __builtin__.property(_get_outer_tag, _set_outer_tag) + second_tag = __builtin__.property(_get_second_tag, _set_second_tag) + + + _pyangbind_elements = OrderedDict([('vlan_tag_classification', vlan_tag_classification), ('outer_tag', outer_tag), ('second_tag', second_tag), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/outer_tag/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/outer_tag/__init__.py new file mode 100644 index 000000000..83e6e19a2 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/outer_tag/__init__.py @@ -0,0 +1,202 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class outer_tag(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/eth-svc/supported-classification/vlan-classification/outer-tag. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Service classification capabilities based on the outer +VLAN tag, supported by the ETH LTP. + """ + __slots__ = ('_path_helper', '_extmethods', '__supported_tag_types','__vlan_bundling','__vlan_range',) + + _yang_name = 'outer-tag' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__supported_tag_types = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},)), is_leaf=False, yang_name="supported-tag-types", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-classify', is_config=True) + self.__vlan_bundling = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="vlan-bundling", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + self.__vlan_range = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="vlan-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vid-range-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'termination-point', 'eth-svc', 'supported-classification', 'vlan-classification', 'outer-tag'] + + def _get_supported_tag_types(self): + """ + Getter method for supported_tag_types, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/outer_tag/supported_tag_types (etht-types:eth-tag-classify) + + YANG Description: List of VLAN tag types that can be used for the VLAN +classification. In case VLAN classification is not +supported, the list is empty. + """ + return self.__supported_tag_types + + def _set_supported_tag_types(self, v, load=False): + """ + Setter method for supported_tag_types, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/outer_tag/supported_tag_types (etht-types:eth-tag-classify) + If this variable is read-only (config: false) in the + source YANG file, then _set_supported_tag_types is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_supported_tag_types() directly. + + YANG Description: List of VLAN tag types that can be used for the VLAN +classification. In case VLAN classification is not +supported, the list is empty. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},)), is_leaf=False, yang_name="supported-tag-types", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-classify', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """supported_tag_types must be of a type compatible with etht-types:eth-tag-classify""", + 'defined-type': "etht-types:eth-tag-classify", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},)), is_leaf=False, yang_name="supported-tag-types", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-classify', is_config=True)""", + }) + + self.__supported_tag_types = t + if hasattr(self, '_set'): + self._set() + + def _unset_supported_tag_types(self): + self.__supported_tag_types = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},)), is_leaf=False, yang_name="supported-tag-types", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-classify', is_config=True) + + + def _get_vlan_bundling(self): + """ + Getter method for vlan_bundling, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/outer_tag/vlan_bundling (boolean) + + YANG Description: In case VLAN classification is supported, indicates whether +VLAN bundling classification is also supported. + """ + return self.__vlan_bundling + + def _set_vlan_bundling(self, v, load=False): + """ + Setter method for vlan_bundling, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/outer_tag/vlan_bundling (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlan_bundling is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlan_bundling() directly. + + YANG Description: In case VLAN classification is supported, indicates whether +VLAN bundling classification is also supported. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="vlan-bundling", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlan_bundling must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="vlan-bundling", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__vlan_bundling = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlan_bundling(self): + self.__vlan_bundling = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="vlan-bundling", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + + + def _get_vlan_range(self): + """ + Getter method for vlan_range, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/outer_tag/vlan_range (etht-types:vid-range-type) + + YANG Description: In case VLAN classification is supported, indicates the +of available VLAN ID values. + """ + return self.__vlan_range + + def _set_vlan_range(self, v, load=False): + """ + Setter method for vlan_range, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/outer_tag/vlan_range (etht-types:vid-range-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlan_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlan_range() directly. + + YANG Description: In case VLAN classification is supported, indicates the +of available VLAN ID values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="vlan-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vid-range-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlan_range must be of a type compatible with etht-types:vid-range-type""", + 'defined-type': "etht-types:vid-range-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="vlan-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vid-range-type', is_config=True)""", + }) + + self.__vlan_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlan_range(self): + self.__vlan_range = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="vlan-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vid-range-type', is_config=True) + + supported_tag_types = __builtin__.property(_get_supported_tag_types, _set_supported_tag_types) + vlan_bundling = __builtin__.property(_get_vlan_bundling, _set_vlan_bundling) + vlan_range = __builtin__.property(_get_vlan_range, _set_vlan_range) + + + _pyangbind_elements = OrderedDict([('supported_tag_types', supported_tag_types), ('vlan_bundling', vlan_bundling), ('vlan_range', vlan_range), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/second_tag/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/second_tag/__init__.py new file mode 100644 index 000000000..98c6f2462 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/second_tag/__init__.py @@ -0,0 +1,243 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class second_tag(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/eth-svc/supported-classification/vlan-classification/second-tag. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Service classification capabilities based on the second +VLAN tag, supported by the ETH LTP. + """ + __slots__ = ('_path_helper', '_extmethods', '__second_tag_classification','__supported_tag_types','__vlan_bundling','__vlan_range',) + + _yang_name = 'second-tag' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__second_tag_classification = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="second-tag-classification", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + self.__supported_tag_types = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},)), is_leaf=False, yang_name="supported-tag-types", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-classify', is_config=True) + self.__vlan_bundling = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="vlan-bundling", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + self.__vlan_range = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="vlan-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vid-range-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'termination-point', 'eth-svc', 'supported-classification', 'vlan-classification', 'second-tag'] + + def _get_second_tag_classification(self): + """ + Getter method for second_tag_classification, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/second_tag/second_tag_classification (boolean) + + YANG Description: Indicates that the ETH LTP support VLAN service +classification based on the second VLAN tag. + """ + return self.__second_tag_classification + + def _set_second_tag_classification(self, v, load=False): + """ + Setter method for second_tag_classification, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/second_tag/second_tag_classification (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_second_tag_classification is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_second_tag_classification() directly. + + YANG Description: Indicates that the ETH LTP support VLAN service +classification based on the second VLAN tag. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="second-tag-classification", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """second_tag_classification must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="second-tag-classification", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__second_tag_classification = t + if hasattr(self, '_set'): + self._set() + + def _unset_second_tag_classification(self): + self.__second_tag_classification = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="second-tag-classification", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + + + def _get_supported_tag_types(self): + """ + Getter method for supported_tag_types, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/second_tag/supported_tag_types (etht-types:eth-tag-classify) + + YANG Description: List of VLAN tag types that can be used for the VLAN +classification. In case VLAN classification is not +supported, the list is empty. + """ + return self.__supported_tag_types + + def _set_supported_tag_types(self, v, load=False): + """ + Setter method for supported_tag_types, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/second_tag/supported_tag_types (etht-types:eth-tag-classify) + If this variable is read-only (config: false) in the + source YANG file, then _set_supported_tag_types is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_supported_tag_types() directly. + + YANG Description: List of VLAN tag types that can be used for the VLAN +classification. In case VLAN classification is not +supported, the list is empty. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},)), is_leaf=False, yang_name="supported-tag-types", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-classify', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """supported_tag_types must be of a type compatible with etht-types:eth-tag-classify""", + 'defined-type': "etht-types:eth-tag-classify", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},)), is_leaf=False, yang_name="supported-tag-types", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-classify', is_config=True)""", + }) + + self.__supported_tag_types = t + if hasattr(self, '_set'): + self._set() + + def _unset_supported_tag_types(self): + self.__supported_tag_types = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-s-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:classify-s-or-c-vlan': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},)), is_leaf=False, yang_name="supported-tag-types", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-classify', is_config=True) + + + def _get_vlan_bundling(self): + """ + Getter method for vlan_bundling, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/second_tag/vlan_bundling (boolean) + + YANG Description: In case VLAN classification is supported, indicates whether +VLAN bundling classification is also supported. + """ + return self.__vlan_bundling + + def _set_vlan_bundling(self, v, load=False): + """ + Setter method for vlan_bundling, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/second_tag/vlan_bundling (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlan_bundling is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlan_bundling() directly. + + YANG Description: In case VLAN classification is supported, indicates whether +VLAN bundling classification is also supported. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="vlan-bundling", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlan_bundling must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="vlan-bundling", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__vlan_bundling = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlan_bundling(self): + self.__vlan_bundling = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="vlan-bundling", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + + + def _get_vlan_range(self): + """ + Getter method for vlan_range, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/second_tag/vlan_range (etht-types:vid-range-type) + + YANG Description: In case VLAN classification is supported, indicates the +of available VLAN ID values. + """ + return self.__vlan_range + + def _set_vlan_range(self, v, load=False): + """ + Setter method for vlan_range, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_classification/vlan_classification/second_tag/vlan_range (etht-types:vid-range-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlan_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlan_range() directly. + + YANG Description: In case VLAN classification is supported, indicates the +of available VLAN ID values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="vlan-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vid-range-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlan_range must be of a type compatible with etht-types:vid-range-type""", + 'defined-type': "etht-types:vid-range-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="vlan-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vid-range-type', is_config=True)""", + }) + + self.__vlan_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlan_range(self): + self.__vlan_range = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="vlan-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vid-range-type', is_config=True) + + second_tag_classification = __builtin__.property(_get_second_tag_classification, _set_second_tag_classification) + supported_tag_types = __builtin__.property(_get_supported_tag_types, _set_supported_tag_types) + vlan_bundling = __builtin__.property(_get_vlan_bundling, _set_vlan_bundling) + vlan_range = __builtin__.property(_get_vlan_range, _set_vlan_range) + + + _pyangbind_elements = OrderedDict([('second_tag_classification', second_tag_classification), ('supported_tag_types', supported_tag_types), ('vlan_bundling', vlan_bundling), ('vlan_range', vlan_range), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_vlan_operations/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_vlan_operations/__init__.py new file mode 100644 index 000000000..9b5cfc5b2 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_vlan_operations/__init__.py @@ -0,0 +1,240 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import vlan_pop +from . import vlan_push +class supported_vlan_operations(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/eth-svc/supported-vlan-operations. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Reports the VLAN operations supported by the ETH LTP. + """ + __slots__ = ('_path_helper', '_extmethods', '__asymmetrical_operations','__transparent_vlan_operations','__vlan_pop','__vlan_push',) + + _yang_name = 'supported-vlan-operations' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__asymmetrical_operations = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="asymmetrical-operations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + self.__transparent_vlan_operations = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="transparent-vlan-operations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + self.__vlan_pop = YANGDynClass(base=vlan_pop.vlan_pop, is_container='container', yang_name="vlan-pop", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + self.__vlan_push = YANGDynClass(base=vlan_push.vlan_push, is_container='container', yang_name="vlan-push", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'termination-point', 'eth-svc', 'supported-vlan-operations'] + + def _get_asymmetrical_operations(self): + """ + Getter method for asymmetrical_operations, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/asymmetrical_operations (boolean) + + YANG Description: Indicates whether the ETH LTP supports also asymmetrical +VLAN operations.It is assumed that symmetrical VLAN +operations are alwyas supported. + """ + return self.__asymmetrical_operations + + def _set_asymmetrical_operations(self, v, load=False): + """ + Setter method for asymmetrical_operations, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/asymmetrical_operations (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_asymmetrical_operations is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_asymmetrical_operations() directly. + + YANG Description: Indicates whether the ETH LTP supports also asymmetrical +VLAN operations.It is assumed that symmetrical VLAN +operations are alwyas supported. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="asymmetrical-operations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """asymmetrical_operations must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="asymmetrical-operations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__asymmetrical_operations = t + if hasattr(self, '_set'): + self._set() + + def _unset_asymmetrical_operations(self): + self.__asymmetrical_operations = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="asymmetrical-operations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + + + def _get_transparent_vlan_operations(self): + """ + Getter method for transparent_vlan_operations, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/transparent_vlan_operations (boolean) + + YANG Description: Indicates that the ETH LTP supports transparent +operations. + """ + return self.__transparent_vlan_operations + + def _set_transparent_vlan_operations(self, v, load=False): + """ + Setter method for transparent_vlan_operations, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/transparent_vlan_operations (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_transparent_vlan_operations is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_transparent_vlan_operations() directly. + + YANG Description: Indicates that the ETH LTP supports transparent +operations. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="transparent-vlan-operations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """transparent_vlan_operations must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="transparent-vlan-operations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__transparent_vlan_operations = t + if hasattr(self, '_set'): + self._set() + + def _unset_transparent_vlan_operations(self): + self.__transparent_vlan_operations = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="transparent-vlan-operations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + + + def _get_vlan_pop(self): + """ + Getter method for vlan_pop, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_pop (container) + + YANG Description: Indicates VLAN pop or swap operations capabilities. + """ + return self.__vlan_pop + + def _set_vlan_pop(self, v, load=False): + """ + Setter method for vlan_pop, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_pop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlan_pop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlan_pop() directly. + + YANG Description: Indicates VLAN pop or swap operations capabilities. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=vlan_pop.vlan_pop, is_container='container', yang_name="vlan-pop", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlan_pop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=vlan_pop.vlan_pop, is_container='container', yang_name="vlan-pop", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True)""", + }) + + self.__vlan_pop = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlan_pop(self): + self.__vlan_pop = YANGDynClass(base=vlan_pop.vlan_pop, is_container='container', yang_name="vlan-pop", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + + def _get_vlan_push(self): + """ + Getter method for vlan_push, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push (container) + + YANG Description: Indicates VLAN push or swap operations capabilities. + """ + return self.__vlan_push + + def _set_vlan_push(self, v, load=False): + """ + Setter method for vlan_push, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlan_push is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlan_push() directly. + + YANG Description: Indicates VLAN push or swap operations capabilities. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=vlan_push.vlan_push, is_container='container', yang_name="vlan-push", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlan_push must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=vlan_push.vlan_push, is_container='container', yang_name="vlan-push", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True)""", + }) + + self.__vlan_push = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlan_push(self): + self.__vlan_push = YANGDynClass(base=vlan_push.vlan_push, is_container='container', yang_name="vlan-push", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + asymmetrical_operations = __builtin__.property(_get_asymmetrical_operations, _set_asymmetrical_operations) + transparent_vlan_operations = __builtin__.property(_get_transparent_vlan_operations, _set_transparent_vlan_operations) + vlan_pop = __builtin__.property(_get_vlan_pop, _set_vlan_pop) + vlan_push = __builtin__.property(_get_vlan_push, _set_vlan_push) + + + _pyangbind_elements = OrderedDict([('asymmetrical_operations', asymmetrical_operations), ('transparent_vlan_operations', transparent_vlan_operations), ('vlan_pop', vlan_pop), ('vlan_push', vlan_push), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_pop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_pop/__init__.py new file mode 100644 index 000000000..bfeb46635 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_pop/__init__.py @@ -0,0 +1,158 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class vlan_pop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/eth-svc/supported-vlan-operations/vlan-pop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Indicates VLAN pop or swap operations capabilities. + """ + __slots__ = ('_path_helper', '_extmethods', '__vlan_pop_operations','__max_pop_tags',) + + _yang_name = 'vlan-pop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__vlan_pop_operations = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="vlan-pop-operations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + self.__max_pop_tags = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['1..2']}), is_leaf=True, yang_name="max-pop-tags", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'termination-point', 'eth-svc', 'supported-vlan-operations', 'vlan-pop'] + + def _get_vlan_pop_operations(self): + """ + Getter method for vlan_pop_operations, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_pop/vlan_pop_operations (boolean) + + YANG Description: Indicates that the ETH LTP supports VLAN pop or +swap operations. + """ + return self.__vlan_pop_operations + + def _set_vlan_pop_operations(self, v, load=False): + """ + Setter method for vlan_pop_operations, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_pop/vlan_pop_operations (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlan_pop_operations is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlan_pop_operations() directly. + + YANG Description: Indicates that the ETH LTP supports VLAN pop or +swap operations. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="vlan-pop-operations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlan_pop_operations must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="vlan-pop-operations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__vlan_pop_operations = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlan_pop_operations(self): + self.__vlan_pop_operations = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="vlan-pop-operations", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + + + def _get_max_pop_tags(self): + """ + Getter method for max_pop_tags, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_pop/max_pop_tags (uint8) + + YANG Description: Indicates the maximum number of tags that can be +popped/swapped. + """ + return self.__max_pop_tags + + def _set_max_pop_tags(self, v, load=False): + """ + Setter method for max_pop_tags, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_pop/max_pop_tags (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_max_pop_tags is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_max_pop_tags() directly. + + YANG Description: Indicates the maximum number of tags that can be +popped/swapped. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['1..2']}), is_leaf=True, yang_name="max-pop-tags", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """max_pop_tags must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['1..2']}), is_leaf=True, yang_name="max-pop-tags", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__max_pop_tags = t + if hasattr(self, '_set'): + self._set() + + def _unset_max_pop_tags(self): + self.__max_pop_tags = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['1..2']}), is_leaf=True, yang_name="max-pop-tags", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True) + + vlan_pop_operations = __builtin__.property(_get_vlan_pop_operations, _set_vlan_pop_operations) + max_pop_tags = __builtin__.property(_get_max_pop_tags, _set_max_pop_tags) + + + _pyangbind_elements = OrderedDict([('vlan_pop_operations', vlan_pop_operations), ('max_pop_tags', max_pop_tags), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/__init__.py new file mode 100644 index 000000000..256af6aa1 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/__init__.py @@ -0,0 +1,201 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import outer_tag +from . import second_tag +class vlan_push(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/eth-svc/supported-vlan-operations/vlan-push. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Indicates VLAN push or swap operations capabilities. + """ + __slots__ = ('_path_helper', '_extmethods', '__vlan_push_operation','__outer_tag','__second_tag',) + + _yang_name = 'vlan-push' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__vlan_push_operation = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="vlan-push-operation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + self.__outer_tag = YANGDynClass(base=outer_tag.outer_tag, is_container='container', yang_name="outer-tag", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + self.__second_tag = YANGDynClass(base=second_tag.second_tag, is_container='container', yang_name="second-tag", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'termination-point', 'eth-svc', 'supported-vlan-operations', 'vlan-push'] + + def _get_vlan_push_operation(self): + """ + Getter method for vlan_push_operation, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/vlan_push_operation (boolean) + + YANG Description: Indicates that the ETH LTP supports VLAN push or +swap operations. + """ + return self.__vlan_push_operation + + def _set_vlan_push_operation(self, v, load=False): + """ + Setter method for vlan_push_operation, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/vlan_push_operation (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlan_push_operation is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlan_push_operation() directly. + + YANG Description: Indicates that the ETH LTP supports VLAN push or +swap operations. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="vlan-push-operation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlan_push_operation must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="vlan-push-operation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__vlan_push_operation = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlan_push_operation(self): + self.__vlan_push_operation = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="vlan-push-operation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + + + def _get_outer_tag(self): + """ + Getter method for outer_tag, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/outer_tag (container) + + YANG Description: Indicates the supported VLAN operation capabilities +on the outer VLAN tag. + """ + return self.__outer_tag + + def _set_outer_tag(self, v, load=False): + """ + Setter method for outer_tag, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/outer_tag (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_outer_tag is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_outer_tag() directly. + + YANG Description: Indicates the supported VLAN operation capabilities +on the outer VLAN tag. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=outer_tag.outer_tag, is_container='container', yang_name="outer-tag", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """outer_tag must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=outer_tag.outer_tag, is_container='container', yang_name="outer-tag", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True)""", + }) + + self.__outer_tag = t + if hasattr(self, '_set'): + self._set() + + def _unset_outer_tag(self): + self.__outer_tag = YANGDynClass(base=outer_tag.outer_tag, is_container='container', yang_name="outer-tag", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + + def _get_second_tag(self): + """ + Getter method for second_tag, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/second_tag (container) + + YANG Description: Indicates the supported VLAN operation capabilities +on the second VLAN tag. + """ + return self.__second_tag + + def _set_second_tag(self, v, load=False): + """ + Setter method for second_tag, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/second_tag (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_second_tag is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_second_tag() directly. + + YANG Description: Indicates the supported VLAN operation capabilities +on the second VLAN tag. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=second_tag.second_tag, is_container='container', yang_name="second-tag", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """second_tag must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=second_tag.second_tag, is_container='container', yang_name="second-tag", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True)""", + }) + + self.__second_tag = t + if hasattr(self, '_set'): + self._set() + + def _unset_second_tag(self): + self.__second_tag = YANGDynClass(base=second_tag.second_tag, is_container='container', yang_name="second-tag", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + vlan_push_operation = __builtin__.property(_get_vlan_push_operation, _set_vlan_push_operation) + outer_tag = __builtin__.property(_get_outer_tag, _set_outer_tag) + second_tag = __builtin__.property(_get_second_tag, _set_second_tag) + + + _pyangbind_elements = OrderedDict([('vlan_push_operation', vlan_push_operation), ('outer_tag', outer_tag), ('second_tag', second_tag), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/outer_tag/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/outer_tag/__init__.py new file mode 100644 index 000000000..c468dbf17 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/outer_tag/__init__.py @@ -0,0 +1,161 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class outer_tag(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/eth-svc/supported-vlan-operations/vlan-push/outer-tag. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Indicates the supported VLAN operation capabilities +on the outer VLAN tag. + """ + __slots__ = ('_path_helper', '_extmethods', '__supported_tag_types','__vlan_range',) + + _yang_name = 'outer-tag' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__supported_tag_types = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},)), is_leaf=False, yang_name="supported-tag-types", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + self.__vlan_range = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="vlan-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vid-range-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'termination-point', 'eth-svc', 'supported-vlan-operations', 'vlan-push', 'outer-tag'] + + def _get_supported_tag_types(self): + """ + Getter method for supported_tag_types, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/outer_tag/supported_tag_types (etht-types:eth-tag-type) + + YANG Description: List of VLAN tag types that can be used to push or swap a +VLAN tag. In case VLAN push/swap is not supported, the list +is empty. + """ + return self.__supported_tag_types + + def _set_supported_tag_types(self, v, load=False): + """ + Setter method for supported_tag_types, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/outer_tag/supported_tag_types (etht-types:eth-tag-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_supported_tag_types is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_supported_tag_types() directly. + + YANG Description: List of VLAN tag types that can be used to push or swap a +VLAN tag. In case VLAN push/swap is not supported, the list +is empty. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},)), is_leaf=False, yang_name="supported-tag-types", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """supported_tag_types must be of a type compatible with etht-types:eth-tag-type""", + 'defined-type': "etht-types:eth-tag-type", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},)), is_leaf=False, yang_name="supported-tag-types", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True)""", + }) + + self.__supported_tag_types = t + if hasattr(self, '_set'): + self._set() + + def _unset_supported_tag_types(self): + self.__supported_tag_types = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},)), is_leaf=False, yang_name="supported-tag-types", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + + + def _get_vlan_range(self): + """ + Getter method for vlan_range, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/outer_tag/vlan_range (etht-types:vid-range-type) + + YANG Description: In case VLAN push/swap operation is supported, the range +of available VLAN ID values. + """ + return self.__vlan_range + + def _set_vlan_range(self, v, load=False): + """ + Setter method for vlan_range, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/outer_tag/vlan_range (etht-types:vid-range-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlan_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlan_range() directly. + + YANG Description: In case VLAN push/swap operation is supported, the range +of available VLAN ID values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="vlan-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vid-range-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlan_range must be of a type compatible with etht-types:vid-range-type""", + 'defined-type': "etht-types:vid-range-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="vlan-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vid-range-type', is_config=True)""", + }) + + self.__vlan_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlan_range(self): + self.__vlan_range = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="vlan-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vid-range-type', is_config=True) + + supported_tag_types = __builtin__.property(_get_supported_tag_types, _set_supported_tag_types) + vlan_range = __builtin__.property(_get_vlan_range, _set_vlan_range) + + + _pyangbind_elements = OrderedDict([('supported_tag_types', supported_tag_types), ('vlan_range', vlan_range), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/second_tag/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/second_tag/__init__.py new file mode 100644 index 000000000..33831d331 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/second_tag/__init__.py @@ -0,0 +1,202 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class second_tag(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/eth-svc/supported-vlan-operations/vlan-push/second-tag. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Indicates the supported VLAN operation capabilities +on the second VLAN tag. + """ + __slots__ = ('_path_helper', '_extmethods', '__push_second_tag','__supported_tag_types','__vlan_range',) + + _yang_name = 'second-tag' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__push_second_tag = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="push-second-tag", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + self.__supported_tag_types = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},)), is_leaf=False, yang_name="supported-tag-types", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + self.__vlan_range = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="vlan-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vid-range-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'termination-point', 'eth-svc', 'supported-vlan-operations', 'vlan-push', 'second-tag'] + + def _get_push_second_tag(self): + """ + Getter method for push_second_tag, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/second_tag/push_second_tag (boolean) + + YANG Description: Indicates that the ETH LTP supports VLAN push or swap +operations for the second VLAN tag. + """ + return self.__push_second_tag + + def _set_push_second_tag(self, v, load=False): + """ + Setter method for push_second_tag, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/second_tag/push_second_tag (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_push_second_tag is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_push_second_tag() directly. + + YANG Description: Indicates that the ETH LTP supports VLAN push or swap +operations for the second VLAN tag. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="push-second-tag", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """push_second_tag must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="push-second-tag", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__push_second_tag = t + if hasattr(self, '_set'): + self._set() + + def _unset_push_second_tag(self): + self.__push_second_tag = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="push-second-tag", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='boolean', is_config=True) + + + def _get_supported_tag_types(self): + """ + Getter method for supported_tag_types, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/second_tag/supported_tag_types (etht-types:eth-tag-type) + + YANG Description: List of VLAN tag types that can be used to push or swap a +VLAN tag. In case VLAN push/swap is not supported, the list +is empty. + """ + return self.__supported_tag_types + + def _set_supported_tag_types(self, v, load=False): + """ + Setter method for supported_tag_types, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/second_tag/supported_tag_types (etht-types:eth-tag-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_supported_tag_types is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_supported_tag_types() directly. + + YANG Description: List of VLAN tag types that can be used to push or swap a +VLAN tag. In case VLAN push/swap is not supported, the list +is empty. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},)), is_leaf=False, yang_name="supported-tag-types", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """supported_tag_types must be of a type compatible with etht-types:eth-tag-type""", + 'defined-type': "etht-types:eth-tag-type", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},)), is_leaf=False, yang_name="supported-tag-types", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True)""", + }) + + self.__supported_tag_types = t + if hasattr(self, '_set'): + self._set() + + def _unset_supported_tag_types(self): + self.__supported_tag_types = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},)), is_leaf=False, yang_name="supported-tag-types", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + + + def _get_vlan_range(self): + """ + Getter method for vlan_range, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/second_tag/vlan_range (etht-types:vid-range-type) + + YANG Description: In case VLAN push/swap operation is supported, the range +of available VLAN ID values. + """ + return self.__vlan_range + + def _set_vlan_range(self, v, load=False): + """ + Setter method for vlan_range, mapped from YANG variable /networks/network/node/termination_point/eth_svc/supported_vlan_operations/vlan_push/second_tag/vlan_range (etht-types:vid-range-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlan_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlan_range() directly. + + YANG Description: In case VLAN push/swap operation is supported, the range +of available VLAN ID values. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="vlan-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vid-range-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlan_range must be of a type compatible with etht-types:vid-range-type""", + 'defined-type': "etht-types:vid-range-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="vlan-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vid-range-type', is_config=True)""", + }) + + self.__vlan_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlan_range(self): + self.__vlan_range = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="vlan-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vid-range-type', is_config=True) + + push_second_tag = __builtin__.property(_get_push_second_tag, _set_push_second_tag) + supported_tag_types = __builtin__.property(_get_supported_tag_types, _set_supported_tag_types) + vlan_range = __builtin__.property(_get_vlan_range, _set_vlan_range) + + + _pyangbind_elements = OrderedDict([('push_second_tag', push_second_tag), ('supported_tag_types', supported_tag_types), ('vlan_range', vlan_range), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/supporting_termination_point/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/supporting_termination_point/__init__.py new file mode 100644 index 000000000..cb2a897c8 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/supporting_termination_point/__init__.py @@ -0,0 +1,222 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class supporting_termination_point(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/supporting-termination-point. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This list identifies any termination points on which a +given termination point depends or onto which it maps. +Those termination points will themselves be contained +in a supporting node. This dependency information can be +inferred from the dependencies between links. Therefore, +this item is not separately configurable. Hence, no +corresponding constraint needs to be articulated. +The corresponding information is simply provided by the +implementing system. + """ + __slots__ = ('_path_helper', '_extmethods', '__network_ref','__node_ref','__tp_ref',) + + _yang_name = 'supporting-termination-point' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + self.__node_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="node-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + self.__tp_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'termination-point', 'supporting-termination-point'] + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/node/termination_point/supporting_termination_point/network_ref (leafref) + + YANG Description: This leaf identifies in which topology the +supporting termination point is present. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/node/termination_point/supporting_termination_point/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: This leaf identifies in which topology the +supporting termination point is present. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + + + def _get_node_ref(self): + """ + Getter method for node_ref, mapped from YANG variable /networks/network/node/termination_point/supporting_termination_point/node_ref (leafref) + + YANG Description: This leaf identifies in which node the supporting +termination point is present. + """ + return self.__node_ref + + def _set_node_ref(self, v, load=False): + """ + Setter method for node_ref, mapped from YANG variable /networks/network/node/termination_point/supporting_termination_point/node_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_ref() directly. + + YANG Description: This leaf identifies in which node the supporting +termination point is present. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="node-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="node-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True)""", + }) + + self.__node_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_ref(self): + self.__node_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="node-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + + + def _get_tp_ref(self): + """ + Getter method for tp_ref, mapped from YANG variable /networks/network/node/termination_point/supporting_termination_point/tp_ref (leafref) + + YANG Description: Reference to the underlay node (the underlay node must +be in a different topology). + """ + return self.__tp_ref + + def _set_tp_ref(self, v, load=False): + """ + Setter method for tp_ref, mapped from YANG variable /networks/network/node/termination_point/supporting_termination_point/tp_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tp_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tp_ref() directly. + + YANG Description: Reference to the underlay node (the underlay node must +be in a different topology). + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tp_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True)""", + }) + + self.__tp_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_tp_ref(self): + self.__tp_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tp-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network-topology', defining_module='ietf-network-topology', yang_type='leafref', is_config=True) + + network_ref = __builtin__.property(_get_network_ref, _set_network_ref) + node_ref = __builtin__.property(_get_node_ref, _set_node_ref) + tp_ref = __builtin__.property(_get_tp_ref, _set_tp_ref) + + + _pyangbind_elements = OrderedDict([('network_ref', network_ref), ('node_ref', node_ref), ('tp_ref', tp_ref), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/__init__.py new file mode 100644 index 000000000..4c7ab6264 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/__init__.py @@ -0,0 +1,445 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import interface_switching_capability +from . import geolocation +from . import otn_ltp +from . import client_svc +class te(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/te. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Indicates TE support. + """ + __slots__ = ('_path_helper', '_extmethods', '__admin_status','__name','__interface_switching_capability','__inter_domain_plug_id','__inter_layer_lock_id','__oper_status','__geolocation','__otn_ltp','__client_svc',) + + _yang_name = 'te' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__admin_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True) + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + self.__interface_switching_capability = YANGDynClass(base=YANGListType("switching_capability encoding",interface_switching_capability.interface_switching_capability, yang_name="interface-switching-capability", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='switching-capability encoding', extensions=None), is_container='list', yang_name="interface-switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + self.__inter_domain_plug_id = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="inter-domain-plug-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + self.__inter_layer_lock_id = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="inter-layer-lock-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__oper_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-oper-status', is_config=False) + self.__geolocation = YANGDynClass(base=geolocation.geolocation, is_container='container', yang_name="geolocation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + self.__otn_ltp = YANGDynClass(base=otn_ltp.otn_ltp, is_container='container', yang_name="otn-ltp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__client_svc = YANGDynClass(base=client_svc.client_svc, is_container='container', yang_name="client-svc", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'termination-point', 'te'] + + def _get_admin_status(self): + """ + Getter method for admin_status, mapped from YANG variable /networks/network/node/termination_point/te/admin_status (te-types:te-admin-status) + + YANG Description: The administrative state of the LTP. + """ + return self.__admin_status + + def _set_admin_status(self, v, load=False): + """ + Setter method for admin_status, mapped from YANG variable /networks/network/node/termination_point/te/admin_status (te-types:te-admin-status) + If this variable is read-only (config: false) in the + source YANG file, then _set_admin_status is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_admin_status() directly. + + YANG Description: The administrative state of the LTP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """admin_status must be of a type compatible with te-types:te-admin-status""", + 'defined-type': "te-types:te-admin-status", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True)""", + }) + + self.__admin_status = t + if hasattr(self, '_set'): + self._set() + + def _unset_admin_status(self): + self.__admin_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True) + + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /networks/network/node/termination_point/te/name (string) + + YANG Description: A descriptive name for the LTP. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /networks/network/node/termination_point/te/name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: A descriptive name for the LTP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + + def _get_interface_switching_capability(self): + """ + Getter method for interface_switching_capability, mapped from YANG variable /networks/network/node/termination_point/te/interface_switching_capability (list) + + YANG Description: List of ISCDs for this link. + """ + return self.__interface_switching_capability + + def _set_interface_switching_capability(self, v, load=False): + """ + Setter method for interface_switching_capability, mapped from YANG variable /networks/network/node/termination_point/te/interface_switching_capability (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_interface_switching_capability is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_interface_switching_capability() directly. + + YANG Description: List of ISCDs for this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("switching_capability encoding",interface_switching_capability.interface_switching_capability, yang_name="interface-switching-capability", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='switching-capability encoding', extensions=None), is_container='list', yang_name="interface-switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """interface_switching_capability must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("switching_capability encoding",interface_switching_capability.interface_switching_capability, yang_name="interface-switching-capability", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='switching-capability encoding', extensions=None), is_container='list', yang_name="interface-switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__interface_switching_capability = t + if hasattr(self, '_set'): + self._set() + + def _unset_interface_switching_capability(self): + self.__interface_switching_capability = YANGDynClass(base=YANGListType("switching_capability encoding",interface_switching_capability.interface_switching_capability, yang_name="interface-switching-capability", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='switching-capability encoding', extensions=None), is_container='list', yang_name="interface-switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + + def _get_inter_domain_plug_id(self): + """ + Getter method for inter_domain_plug_id, mapped from YANG variable /networks/network/node/termination_point/te/inter_domain_plug_id (binary) + + YANG Description: A network-wide unique number that identifies on the +network a connection that supports a given inter-domain +TE link. This is a more flexible alternative to specifying +'remote-te-node-id' and 'remote-te-link-tp-id' on a TE link +when the provider either does not know 'remote-te-node-id' +and 'remote-te-link-tp-id' or needs to give the client the +flexibility to mix and match multiple topologies. + """ + return self.__inter_domain_plug_id + + def _set_inter_domain_plug_id(self, v, load=False): + """ + Setter method for inter_domain_plug_id, mapped from YANG variable /networks/network/node/termination_point/te/inter_domain_plug_id (binary) + If this variable is read-only (config: false) in the + source YANG file, then _set_inter_domain_plug_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_inter_domain_plug_id() directly. + + YANG Description: A network-wide unique number that identifies on the +network a connection that supports a given inter-domain +TE link. This is a more flexible alternative to specifying +'remote-te-node-id' and 'remote-te-link-tp-id' on a TE link +when the provider either does not know 'remote-te-node-id' +and 'remote-te-link-tp-id' or needs to give the client the +flexibility to mix and match multiple topologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="inter-domain-plug-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """inter_domain_plug_id must be of a type compatible with binary""", + 'defined-type': "binary", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="inter-domain-plug-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True)""", + }) + + self.__inter_domain_plug_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_inter_domain_plug_id(self): + self.__inter_domain_plug_id = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="inter-domain-plug-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + + + def _get_inter_layer_lock_id(self): + """ + Getter method for inter_layer_lock_id, mapped from YANG variable /networks/network/node/termination_point/te/inter_layer_lock_id (uint32) + + YANG Description: Inter-layer lock ID, used for path computation in a TE +topology covering multiple layers or multiple regions. + """ + return self.__inter_layer_lock_id + + def _set_inter_layer_lock_id(self, v, load=False): + """ + Setter method for inter_layer_lock_id, mapped from YANG variable /networks/network/node/termination_point/te/inter_layer_lock_id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_inter_layer_lock_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_inter_layer_lock_id() directly. + + YANG Description: Inter-layer lock ID, used for path computation in a TE +topology covering multiple layers or multiple regions. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="inter-layer-lock-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """inter_layer_lock_id must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="inter-layer-lock-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__inter_layer_lock_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_inter_layer_lock_id(self): + self.__inter_layer_lock_id = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="inter-layer-lock-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_oper_status(self): + """ + Getter method for oper_status, mapped from YANG variable /networks/network/node/termination_point/te/oper_status (te-types:te-oper-status) + + YANG Description: The current operational state of the LTP. + """ + return self.__oper_status + + def _set_oper_status(self, v, load=False): + """ + Setter method for oper_status, mapped from YANG variable /networks/network/node/termination_point/te/oper_status (te-types:te-oper-status) + If this variable is read-only (config: false) in the + source YANG file, then _set_oper_status is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_oper_status() directly. + + YANG Description: The current operational state of the LTP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-oper-status', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """oper_status must be of a type compatible with te-types:te-oper-status""", + 'defined-type': "te-types:te-oper-status", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-oper-status', is_config=False)""", + }) + + self.__oper_status = t + if hasattr(self, '_set'): + self._set() + + def _unset_oper_status(self): + self.__oper_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-oper-status', is_config=False) + + + def _get_geolocation(self): + """ + Getter method for geolocation, mapped from YANG variable /networks/network/node/termination_point/te/geolocation (container) + + YANG Description: Contains a GPS location. + """ + return self.__geolocation + + def _set_geolocation(self, v, load=False): + """ + Setter method for geolocation, mapped from YANG variable /networks/network/node/termination_point/te/geolocation (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_geolocation is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_geolocation() directly. + + YANG Description: Contains a GPS location. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=geolocation.geolocation, is_container='container', yang_name="geolocation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """geolocation must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=geolocation.geolocation, is_container='container', yang_name="geolocation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__geolocation = t + if hasattr(self, '_set'): + self._set() + + def _unset_geolocation(self): + self.__geolocation = YANGDynClass(base=geolocation.geolocation, is_container='container', yang_name="geolocation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + + def _get_otn_ltp(self): + """ + Getter method for otn_ltp, mapped from YANG variable /networks/network/node/termination_point/te/otn_ltp (container) + + YANG Description: Attributes of the OTN Link Termination Point (LTP). + """ + return self.__otn_ltp + + def _set_otn_ltp(self, v, load=False): + """ + Setter method for otn_ltp, mapped from YANG variable /networks/network/node/termination_point/te/otn_ltp (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn_ltp is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn_ltp() directly. + + YANG Description: Attributes of the OTN Link Termination Point (LTP). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn_ltp.otn_ltp, is_container='container', yang_name="otn-ltp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn_ltp must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn_ltp.otn_ltp, is_container='container', yang_name="otn-ltp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn_ltp = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn_ltp(self): + self.__otn_ltp = YANGDynClass(base=otn_ltp.otn_ltp, is_container='container', yang_name="otn-ltp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_client_svc(self): + """ + Getter method for client_svc, mapped from YANG variable /networks/network/node/termination_point/te/client_svc (container) + + YANG Description: OTN LTP Service attributes. + """ + return self.__client_svc + + def _set_client_svc(self, v, load=False): + """ + Setter method for client_svc, mapped from YANG variable /networks/network/node/termination_point/te/client_svc (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_client_svc is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_client_svc() directly. + + YANG Description: OTN LTP Service attributes. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=client_svc.client_svc, is_container='container', yang_name="client-svc", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """client_svc must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=client_svc.client_svc, is_container='container', yang_name="client-svc", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__client_svc = t + if hasattr(self, '_set'): + self._set() + + def _unset_client_svc(self): + self.__client_svc = YANGDynClass(base=client_svc.client_svc, is_container='container', yang_name="client-svc", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + admin_status = __builtin__.property(_get_admin_status, _set_admin_status) + name = __builtin__.property(_get_name, _set_name) + interface_switching_capability = __builtin__.property(_get_interface_switching_capability, _set_interface_switching_capability) + inter_domain_plug_id = __builtin__.property(_get_inter_domain_plug_id, _set_inter_domain_plug_id) + inter_layer_lock_id = __builtin__.property(_get_inter_layer_lock_id, _set_inter_layer_lock_id) + oper_status = __builtin__.property(_get_oper_status) + geolocation = __builtin__.property(_get_geolocation) + otn_ltp = __builtin__.property(_get_otn_ltp, _set_otn_ltp) + client_svc = __builtin__.property(_get_client_svc, _set_client_svc) + + + _pyangbind_elements = OrderedDict([('admin_status', admin_status), ('name', name), ('interface_switching_capability', interface_switching_capability), ('inter_domain_plug_id', inter_domain_plug_id), ('inter_layer_lock_id', inter_layer_lock_id), ('oper_status', oper_status), ('geolocation', geolocation), ('otn_ltp', otn_ltp), ('client_svc', client_svc), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/client_svc/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/client_svc/__init__.py new file mode 100644 index 000000000..6dd0b2c13 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/client_svc/__init__.py @@ -0,0 +1,115 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class client_svc(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/te/client-svc. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: OTN LTP Service attributes. + """ + __slots__ = ('_path_helper', '_extmethods', '__supported_client_signal',) + + _yang_name = 'client-svc' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__supported_client_signal = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="supported-client-signal", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'termination-point', 'te', 'client-svc'] + + def _get_supported_client_signal(self): + """ + Getter method for supported_client_signal, mapped from YANG variable /networks/network/node/termination_point/te/client_svc/supported_client_signal (identityref) + + YANG Description: List of client signal types supported by the LTP. + """ + return self.__supported_client_signal + + def _set_supported_client_signal(self, v, load=False): + """ + Setter method for supported_client_signal, mapped from YANG variable /networks/network/node/termination_point/te/client_svc/supported_client_signal (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_supported_client_signal is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_supported_client_signal() directly. + + YANG Description: List of client signal types supported by the LTP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="supported-client-signal", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """supported_client_signal must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="supported-client-signal", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__supported_client_signal = t + if hasattr(self, '_set'): + self._set() + + def _unset_supported_client_signal(self): + self.__supported_client_signal = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-1Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-10Gb-LAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-10Gb-WAN': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-40Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ETH-100Gb': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-16': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-64': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:STM-256': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-12': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-48': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-192': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:OC-768': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-100': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-400': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-800': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-1200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-1600': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FC-3200': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FICON-4G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:FICON-8G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="supported-client-signal", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + supported_client_signal = __builtin__.property(_get_supported_client_signal, _set_supported_client_signal) + + + _pyangbind_elements = OrderedDict([('supported_client_signal', supported_client_signal), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/geolocation/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/geolocation/__init__.py new file mode 100644 index 000000000..a02b6d62f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/geolocation/__init__.py @@ -0,0 +1,193 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class geolocation(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/te/geolocation. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains a GPS location. + """ + __slots__ = ('_path_helper', '_extmethods', '__altitude','__latitude','__longitude',) + + _yang_name = 'geolocation' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__altitude = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64), is_leaf=True, yang_name="altitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int64', is_config=False) + self.__latitude = YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-90..90']}), is_leaf=True, yang_name="latitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False) + self.__longitude = YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-180..180']}), is_leaf=True, yang_name="longitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'termination-point', 'te', 'geolocation'] + + def _get_altitude(self): + """ + Getter method for altitude, mapped from YANG variable /networks/network/node/termination_point/te/geolocation/altitude (int64) + + YANG Description: Distance above sea level. + """ + return self.__altitude + + def _set_altitude(self, v, load=False): + """ + Setter method for altitude, mapped from YANG variable /networks/network/node/termination_point/te/geolocation/altitude (int64) + If this variable is read-only (config: false) in the + source YANG file, then _set_altitude is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_altitude() directly. + + YANG Description: Distance above sea level. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64), is_leaf=True, yang_name="altitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """altitude must be of a type compatible with int64""", + 'defined-type': "int64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64), is_leaf=True, yang_name="altitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int64', is_config=False)""", + }) + + self.__altitude = t + if hasattr(self, '_set'): + self._set() + + def _unset_altitude(self): + self.__altitude = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64), is_leaf=True, yang_name="altitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int64', is_config=False) + + + def _get_latitude(self): + """ + Getter method for latitude, mapped from YANG variable /networks/network/node/termination_point/te/geolocation/latitude (geographic-coordinate-degree) + + YANG Description: Relative position north or south on the Earth's surface. + """ + return self.__latitude + + def _set_latitude(self, v, load=False): + """ + Setter method for latitude, mapped from YANG variable /networks/network/node/termination_point/te/geolocation/latitude (geographic-coordinate-degree) + If this variable is read-only (config: false) in the + source YANG file, then _set_latitude is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_latitude() directly. + + YANG Description: Relative position north or south on the Earth's surface. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-90..90']}), is_leaf=True, yang_name="latitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """latitude must be of a type compatible with geographic-coordinate-degree""", + 'defined-type': "ietf-te-topology:geographic-coordinate-degree", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-90..90']}), is_leaf=True, yang_name="latitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False)""", + }) + + self.__latitude = t + if hasattr(self, '_set'): + self._set() + + def _unset_latitude(self): + self.__latitude = YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-90..90']}), is_leaf=True, yang_name="latitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False) + + + def _get_longitude(self): + """ + Getter method for longitude, mapped from YANG variable /networks/network/node/termination_point/te/geolocation/longitude (geographic-coordinate-degree) + + YANG Description: Angular distance east or west on the Earth's surface. + """ + return self.__longitude + + def _set_longitude(self, v, load=False): + """ + Setter method for longitude, mapped from YANG variable /networks/network/node/termination_point/te/geolocation/longitude (geographic-coordinate-degree) + If this variable is read-only (config: false) in the + source YANG file, then _set_longitude is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_longitude() directly. + + YANG Description: Angular distance east or west on the Earth's surface. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-180..180']}), is_leaf=True, yang_name="longitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """longitude must be of a type compatible with geographic-coordinate-degree""", + 'defined-type': "ietf-te-topology:geographic-coordinate-degree", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-180..180']}), is_leaf=True, yang_name="longitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False)""", + }) + + self.__longitude = t + if hasattr(self, '_set'): + self._set() + + def _unset_longitude(self): + self.__longitude = YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-180..180']}), is_leaf=True, yang_name="longitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False) + + altitude = __builtin__.property(_get_altitude) + latitude = __builtin__.property(_get_latitude) + longitude = __builtin__.property(_get_longitude) + + + _pyangbind_elements = OrderedDict([('altitude', altitude), ('latitude', latitude), ('longitude', longitude), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/interface_switching_capability/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/interface_switching_capability/__init__.py new file mode 100644 index 000000000..e158b30c3 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/interface_switching_capability/__init__.py @@ -0,0 +1,206 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import max_lsp_bandwidth +class interface_switching_capability(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/te/interface-switching-capability. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of ISCDs for this link. + """ + __slots__ = ('_path_helper', '_extmethods', '__switching_capability','__encoding','__max_lsp_bandwidth',) + + _yang_name = 'interface-switching-capability' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__switching_capability = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__encoding = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__max_lsp_bandwidth = YANGDynClass(base=YANGListType("priority",max_lsp_bandwidth.max_lsp_bandwidth, yang_name="max-lsp-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="max-lsp-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'termination-point', 'te', 'interface-switching-capability'] + + def _get_switching_capability(self): + """ + Getter method for switching_capability, mapped from YANG variable /networks/network/node/termination_point/te/interface_switching_capability/switching_capability (identityref) + + YANG Description: Switching capability for this interface. + """ + return self.__switching_capability + + def _set_switching_capability(self, v, load=False): + """ + Setter method for switching_capability, mapped from YANG variable /networks/network/node/termination_point/te/interface_switching_capability/switching_capability (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_switching_capability is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_switching_capability() directly. + + YANG Description: Switching capability for this interface. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """switching_capability must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__switching_capability = t + if hasattr(self, '_set'): + self._set() + + def _unset_switching_capability(self): + self.__switching_capability = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_encoding(self): + """ + Getter method for encoding, mapped from YANG variable /networks/network/node/termination_point/te/interface_switching_capability/encoding (identityref) + + YANG Description: Encoding supported by this interface. + """ + return self.__encoding + + def _set_encoding(self, v, load=False): + """ + Setter method for encoding, mapped from YANG variable /networks/network/node/termination_point/te/interface_switching_capability/encoding (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_encoding is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_encoding() directly. + + YANG Description: Encoding supported by this interface. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """encoding must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__encoding = t + if hasattr(self, '_set'): + self._set() + + def _unset_encoding(self): + self.__encoding = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_max_lsp_bandwidth(self): + """ + Getter method for max_lsp_bandwidth, mapped from YANG variable /networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth (list) + + YANG Description: Maximum Label Switched Path (LSP) bandwidth at +priorities 0-7. + """ + return self.__max_lsp_bandwidth + + def _set_max_lsp_bandwidth(self, v, load=False): + """ + Setter method for max_lsp_bandwidth, mapped from YANG variable /networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_max_lsp_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_max_lsp_bandwidth() directly. + + YANG Description: Maximum Label Switched Path (LSP) bandwidth at +priorities 0-7. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("priority",max_lsp_bandwidth.max_lsp_bandwidth, yang_name="max-lsp-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="max-lsp-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """max_lsp_bandwidth must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("priority",max_lsp_bandwidth.max_lsp_bandwidth, yang_name="max-lsp-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="max-lsp-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__max_lsp_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_max_lsp_bandwidth(self): + self.__max_lsp_bandwidth = YANGDynClass(base=YANGListType("priority",max_lsp_bandwidth.max_lsp_bandwidth, yang_name="max-lsp-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="max-lsp-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + switching_capability = __builtin__.property(_get_switching_capability, _set_switching_capability) + encoding = __builtin__.property(_get_encoding, _set_encoding) + max_lsp_bandwidth = __builtin__.property(_get_max_lsp_bandwidth, _set_max_lsp_bandwidth) + + + _pyangbind_elements = OrderedDict([('switching_capability', switching_capability), ('encoding', encoding), ('max_lsp_bandwidth', max_lsp_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/__init__.py new file mode 100644 index 000000000..429b0f18b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/__init__.py @@ -0,0 +1,163 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_bandwidth +class max_lsp_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/te/interface-switching-capability/max-lsp-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Maximum Label Switched Path (LSP) bandwidth at +priorities 0-7. + """ + __slots__ = ('_path_helper', '_extmethods', '__priority','__te_bandwidth',) + + _yang_name = 'max-lsp-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'termination-point', 'te', 'interface-switching-capability', 'max-lsp-bandwidth'] + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/priority (uint8) + + YANG Description: Priority. + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: Priority. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + + + def _get_te_bandwidth(self): + """ + Getter method for te_bandwidth, mapped from YANG variable /networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth (container) + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + return self.__te_bandwidth + + def _set_te_bandwidth(self, v, load=False): + """ + Setter method for te_bandwidth, mapped from YANG variable /networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_bandwidth() directly. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_bandwidth(self): + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + priority = __builtin__.property(_get_priority, _set_priority) + te_bandwidth = __builtin__.property(_get_te_bandwidth, _set_te_bandwidth) + + + _pyangbind_elements = OrderedDict([('priority', priority), ('te_bandwidth', te_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/__init__.py new file mode 100644 index 000000000..d0326e850 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/__init__.py @@ -0,0 +1,195 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/te/interface-switching-capability/max-lsp-bandwidth/te-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_bandwidth',) + + _yang_name = 'te-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'termination-point', 'te', 'interface-switching-capability', 'max-lsp-bandwidth', 'te-bandwidth'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/generic (te-bandwidth) + + YANG Description: Bandwidth specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/generic (te-bandwidth) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Bandwidth specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with te-bandwidth""", + 'defined-type': "ietf-te-topology:te-bandwidth", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn (container) + + YANG Description: Maximum bandwidth attributes for OTN paths. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Maximum bandwidth attributes for OTN paths. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_eth_bandwidth(self): + """ + Getter method for eth_bandwidth, mapped from YANG variable /networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/eth_bandwidth (uint64) + + YANG Description: Available bandwith value expressed in kilobits per second + """ + return self.__eth_bandwidth + + def _set_eth_bandwidth(self, v, load=False): + """ + Setter method for eth_bandwidth, mapped from YANG variable /networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/eth_bandwidth (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_bandwidth() directly. + + YANG Description: Available bandwith value expressed in kilobits per second + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_bandwidth must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__eth_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_bandwidth(self): + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + eth_bandwidth = __builtin__.property(_get_eth_bandwidth, _set_eth_bandwidth) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['eth_bandwidth']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_bandwidth', eth_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/__init__.py new file mode 100644 index 000000000..fcfb11adf --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/__init__.py @@ -0,0 +1,156 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/te/interface-switching-capability/max-lsp-bandwidth/te-bandwidth/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Maximum bandwidth attributes for OTN paths. + """ + __slots__ = ('_path_helper', '_extmethods', '__odu_type','__max_ts_number',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__max_ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="max-ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'termination-point', 'te', 'interface-switching-capability', 'max-lsp-bandwidth', 'te-bandwidth', 'otn'] + + def _get_odu_type(self): + """ + Getter method for odu_type, mapped from YANG variable /networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/odu_type (identityref) + + YANG Description: ODU type + """ + return self.__odu_type + + def _set_odu_type(self, v, load=False): + """ + Setter method for odu_type, mapped from YANG variable /networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/odu_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type() directly. + + YANG Description: ODU type + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__odu_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type(self): + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_max_ts_number(self): + """ + Getter method for max_ts_number, mapped from YANG variable /networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/max_ts_number (uint16) + + YANG Description: The maximum number of Tributary Slots (TS) that could be +used by an ODUflex LSP. + """ + return self.__max_ts_number + + def _set_max_ts_number(self, v, load=False): + """ + Setter method for max_ts_number, mapped from YANG variable /networks/network/node/termination_point/te/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/max_ts_number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_max_ts_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_max_ts_number() directly. + + YANG Description: The maximum number of Tributary Slots (TS) that could be +used by an ODUflex LSP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="max-ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """max_ts_number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="max-ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__max_ts_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_max_ts_number(self): + self.__max_ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="max-ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + odu_type = __builtin__.property(_get_odu_type, _set_odu_type) + max_ts_number = __builtin__.property(_get_max_ts_number, _set_max_ts_number) + + __choices__ = {'technology': {'otn': ['odu_type', 'max_ts_number']}} + _pyangbind_elements = OrderedDict([('odu_type', odu_type), ('max_ts_number', max_ts_number), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/otn_ltp/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/otn_ltp/__init__.py new file mode 100644 index 000000000..55ef3745b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/node/termination_point/te/otn_ltp/__init__.py @@ -0,0 +1,121 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn_ltp(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/node/termination-point/te/otn-ltp. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Attributes of the OTN Link Termination Point (LTP). + """ + __slots__ = ('_path_helper', '_extmethods', '__odtu_flex_type',) + + _yang_name = 'otn-ltp' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odtu_flex_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'node', 'termination-point', 'te', 'otn-ltp'] + + def _get_odtu_flex_type(self): + """ + Getter method for odtu_flex_type, mapped from YANG variable /networks/network/node/termination_point/te/otn_ltp/odtu_flex_type (l1-types:odtu-flex-type) + + YANG Description: The type of Optical Data Tributary Unit (ODTU) +whose nominal bitrate is used to compute the number of +Tributary Slots (TS) required by the ODUflex LSPs set up +on this OTN Link Termination Point (LTP). + """ + return self.__odtu_flex_type + + def _set_odtu_flex_type(self, v, load=False): + """ + Setter method for odtu_flex_type, mapped from YANG variable /networks/network/node/termination_point/te/otn_ltp/odtu_flex_type (l1-types:odtu-flex-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_odtu_flex_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odtu_flex_type() directly. + + YANG Description: The type of Optical Data Tributary Unit (ODTU) +whose nominal bitrate is used to compute the number of +Tributary Slots (TS) required by the ODUflex LSPs set up +on this OTN Link Termination Point (LTP). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odtu_flex_type must be of a type compatible with l1-types:odtu-flex-type""", + 'defined-type': "l1-types:odtu-flex-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True)""", + }) + + self.__odtu_flex_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odtu_flex_type(self): + self.__odtu_flex_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'2': {}, '3': {}, '4': {}, 'Cn': {}},), is_leaf=True, yang_name="odtu-flex-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='l1-types:odtu-flex-type', is_config=True) + + odtu_flex_type = __builtin__.property(_get_odtu_flex_type, _set_odtu_flex_type) + + + _pyangbind_elements = OrderedDict([('odtu_flex_type', odtu_flex_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/supporting_network/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/supporting_network/__init__.py new file mode 100644 index 000000000..183db8264 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/supporting_network/__init__.py @@ -0,0 +1,121 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class supporting_network(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/supporting-network. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: An underlay network, used to represent layered network +topologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__network_ref',) + + _yang_name = 'supporting-network' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='leafref', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'supporting-network'] + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/network/supporting_network/network_ref (leafref) + + YANG Description: References the underlay network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/network/supporting_network/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: References the underlay network. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='leafref', is_config=True)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-network', defining_module='ietf-network', yang_type='leafref', is_config=True) + + network_ref = __builtin__.property(_get_network_ref, _set_network_ref) + + + _pyangbind_elements = OrderedDict([('network_ref', network_ref), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/te/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/te/__init__.py new file mode 100644 index 000000000..ac4025b54 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/te/__init__.py @@ -0,0 +1,283 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import nsrlg +from . import geolocation +class te(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/te. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Indicates TE support. + """ + __slots__ = ('_path_helper', '_extmethods', '__name','__preference','__optimization_criterion','__nsrlg','__geolocation',) + + _yang_name = 'te' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + self.__preference = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['1..255']}), is_leaf=True, yang_name="preference", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + self.__optimization_criterion = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="optimization-criterion", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__nsrlg = YANGDynClass(base=YANGListType("id",nsrlg.nsrlg, yang_name="nsrlg", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='id', extensions=None), is_container='list', yang_name="nsrlg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + self.__geolocation = YANGDynClass(base=geolocation.geolocation, is_container='container', yang_name="geolocation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'te'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /networks/network/te/name (string) + + YANG Description: Name of the TE topology. This attribute is optional and can +be specified by the operator to describe the TE topology, +which can be useful when 'network-id' (RFC 8345) is not +descriptive and not modifiable because of being generated +by the system. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /networks/network/te/name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: Name of the TE topology. This attribute is optional and can +be specified by the operator to describe the TE topology, +which can be useful when 'network-id' (RFC 8345) is not +descriptive and not modifiable because of being generated +by the system. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + + def _get_preference(self): + """ + Getter method for preference, mapped from YANG variable /networks/network/te/preference (uint8) + + YANG Description: Specifies a preference for this topology. A lower number +indicates a higher preference. + """ + return self.__preference + + def _set_preference(self, v, load=False): + """ + Setter method for preference, mapped from YANG variable /networks/network/te/preference (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_preference is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_preference() directly. + + YANG Description: Specifies a preference for this topology. A lower number +indicates a higher preference. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['1..255']}), is_leaf=True, yang_name="preference", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """preference must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['1..255']}), is_leaf=True, yang_name="preference", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__preference = t + if hasattr(self, '_set'): + self._set() + + def _unset_preference(self): + self.__preference = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['1..255']}), is_leaf=True, yang_name="preference", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + + + def _get_optimization_criterion(self): + """ + Getter method for optimization_criterion, mapped from YANG variable /networks/network/te/optimization_criterion (identityref) + + YANG Description: Optimization criterion applied to this topology. + """ + return self.__optimization_criterion + + def _set_optimization_criterion(self, v, load=False): + """ + Setter method for optimization_criterion, mapped from YANG variable /networks/network/te/optimization_criterion (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_optimization_criterion is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_optimization_criterion() directly. + + YANG Description: Optimization criterion applied to this topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="optimization-criterion", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """optimization_criterion must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="optimization-criterion", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__optimization_criterion = t + if hasattr(self, '_set'): + self._set() + + def _unset_optimization_criterion(self): + self.__optimization_criterion = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-path': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-maximize-residual-bandwidth': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-agg-bandwidth-consumption': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-load-most-loaded-link': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:of-minimize-cost-path-set': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="optimization-criterion", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_nsrlg(self): + """ + Getter method for nsrlg, mapped from YANG variable /networks/network/te/nsrlg (list) + + YANG Description: List of NSRLGs (Non-Shared Risk Link Groups). + """ + return self.__nsrlg + + def _set_nsrlg(self, v, load=False): + """ + Setter method for nsrlg, mapped from YANG variable /networks/network/te/nsrlg (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_nsrlg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_nsrlg() directly. + + YANG Description: List of NSRLGs (Non-Shared Risk Link Groups). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("id",nsrlg.nsrlg, yang_name="nsrlg", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='id', extensions=None), is_container='list', yang_name="nsrlg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """nsrlg must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("id",nsrlg.nsrlg, yang_name="nsrlg", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='id', extensions=None), is_container='list', yang_name="nsrlg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__nsrlg = t + if hasattr(self, '_set'): + self._set() + + def _unset_nsrlg(self): + self.__nsrlg = YANGDynClass(base=YANGListType("id",nsrlg.nsrlg, yang_name="nsrlg", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='id', extensions=None), is_container='list', yang_name="nsrlg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + + def _get_geolocation(self): + """ + Getter method for geolocation, mapped from YANG variable /networks/network/te/geolocation (container) + + YANG Description: Contains a GPS location. + """ + return self.__geolocation + + def _set_geolocation(self, v, load=False): + """ + Setter method for geolocation, mapped from YANG variable /networks/network/te/geolocation (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_geolocation is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_geolocation() directly. + + YANG Description: Contains a GPS location. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=geolocation.geolocation, is_container='container', yang_name="geolocation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """geolocation must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=geolocation.geolocation, is_container='container', yang_name="geolocation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False)""", + }) + + self.__geolocation = t + if hasattr(self, '_set'): + self._set() + + def _unset_geolocation(self): + self.__geolocation = YANGDynClass(base=geolocation.geolocation, is_container='container', yang_name="geolocation", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=False) + + name = __builtin__.property(_get_name, _set_name) + preference = __builtin__.property(_get_preference, _set_preference) + optimization_criterion = __builtin__.property(_get_optimization_criterion, _set_optimization_criterion) + nsrlg = __builtin__.property(_get_nsrlg, _set_nsrlg) + geolocation = __builtin__.property(_get_geolocation) + + + _pyangbind_elements = OrderedDict([('name', name), ('preference', preference), ('optimization_criterion', optimization_criterion), ('nsrlg', nsrlg), ('geolocation', geolocation), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/te/geolocation/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/te/geolocation/__init__.py new file mode 100644 index 000000000..b415c4e43 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/te/geolocation/__init__.py @@ -0,0 +1,193 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class geolocation(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/te/geolocation. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains a GPS location. + """ + __slots__ = ('_path_helper', '_extmethods', '__altitude','__latitude','__longitude',) + + _yang_name = 'geolocation' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__altitude = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64), is_leaf=True, yang_name="altitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int64', is_config=False) + self.__latitude = YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-90..90']}), is_leaf=True, yang_name="latitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False) + self.__longitude = YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-180..180']}), is_leaf=True, yang_name="longitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'te', 'geolocation'] + + def _get_altitude(self): + """ + Getter method for altitude, mapped from YANG variable /networks/network/te/geolocation/altitude (int64) + + YANG Description: Distance above sea level. + """ + return self.__altitude + + def _set_altitude(self, v, load=False): + """ + Setter method for altitude, mapped from YANG variable /networks/network/te/geolocation/altitude (int64) + If this variable is read-only (config: false) in the + source YANG file, then _set_altitude is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_altitude() directly. + + YANG Description: Distance above sea level. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64), is_leaf=True, yang_name="altitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """altitude must be of a type compatible with int64""", + 'defined-type': "int64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64), is_leaf=True, yang_name="altitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int64', is_config=False)""", + }) + + self.__altitude = t + if hasattr(self, '_set'): + self._set() + + def _unset_altitude(self): + self.__altitude = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64), is_leaf=True, yang_name="altitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int64', is_config=False) + + + def _get_latitude(self): + """ + Getter method for latitude, mapped from YANG variable /networks/network/te/geolocation/latitude (geographic-coordinate-degree) + + YANG Description: Relative position north or south on the Earth's surface. + """ + return self.__latitude + + def _set_latitude(self, v, load=False): + """ + Setter method for latitude, mapped from YANG variable /networks/network/te/geolocation/latitude (geographic-coordinate-degree) + If this variable is read-only (config: false) in the + source YANG file, then _set_latitude is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_latitude() directly. + + YANG Description: Relative position north or south on the Earth's surface. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-90..90']}), is_leaf=True, yang_name="latitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """latitude must be of a type compatible with geographic-coordinate-degree""", + 'defined-type': "ietf-te-topology:geographic-coordinate-degree", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-90..90']}), is_leaf=True, yang_name="latitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False)""", + }) + + self.__latitude = t + if hasattr(self, '_set'): + self._set() + + def _unset_latitude(self): + self.__latitude = YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-90..90']}), is_leaf=True, yang_name="latitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False) + + + def _get_longitude(self): + """ + Getter method for longitude, mapped from YANG variable /networks/network/te/geolocation/longitude (geographic-coordinate-degree) + + YANG Description: Angular distance east or west on the Earth's surface. + """ + return self.__longitude + + def _set_longitude(self, v, load=False): + """ + Setter method for longitude, mapped from YANG variable /networks/network/te/geolocation/longitude (geographic-coordinate-degree) + If this variable is read-only (config: false) in the + source YANG file, then _set_longitude is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_longitude() directly. + + YANG Description: Angular distance east or west on the Earth's surface. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-180..180']}), is_leaf=True, yang_name="longitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """longitude must be of a type compatible with geographic-coordinate-degree""", + 'defined-type': "ietf-te-topology:geographic-coordinate-degree", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-180..180']}), is_leaf=True, yang_name="longitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False)""", + }) + + self.__longitude = t + if hasattr(self, '_set'): + self._set() + + def _unset_longitude(self): + self.__longitude = YANGDynClass(base=RestrictedClassType(base_type=RestrictedPrecisionDecimalType(precision=8), restriction_dict={'range': ['-180..180']}), is_leaf=True, yang_name="longitude", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='geographic-coordinate-degree', is_config=False) + + altitude = __builtin__.property(_get_altitude) + latitude = __builtin__.property(_get_latitude) + longitude = __builtin__.property(_get_longitude) + + + _pyangbind_elements = OrderedDict([('altitude', altitude), ('latitude', latitude), ('longitude', longitude), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/te/nsrlg/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/te/nsrlg/__init__.py new file mode 100644 index 000000000..d905efa92 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/te/nsrlg/__init__.py @@ -0,0 +1,159 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class nsrlg(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/te/nsrlg. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of NSRLGs (Non-Shared Risk Link Groups). + """ + __slots__ = ('_path_helper', '_extmethods', '__id','__disjointness',) + + _yang_name = 'nsrlg' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__disjointness = YANGDynClass(base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-path-disjointness', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'te', 'nsrlg'] + + def _get_id(self): + """ + Getter method for id, mapped from YANG variable /networks/network/te/nsrlg/id (uint32) + + YANG Description: Identifies the NSRLG entry. + """ + return self.__id + + def _set_id(self, v, load=False): + """ + Setter method for id, mapped from YANG variable /networks/network/te/nsrlg/id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_id() directly. + + YANG Description: Identifies the NSRLG entry. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """id must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__id = t + if hasattr(self, '_set'): + self._set() + + def _unset_id(self): + self.__id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_disjointness(self): + """ + Getter method for disjointness, mapped from YANG variable /networks/network/te/nsrlg/disjointness (te-types:te-path-disjointness) + + YANG Description: The type of resource disjointness. + """ + return self.__disjointness + + def _set_disjointness(self, v, load=False): + """ + Setter method for disjointness, mapped from YANG variable /networks/network/te/nsrlg/disjointness (te-types:te-path-disjointness) + If this variable is read-only (config: false) in the + source YANG file, then _set_disjointness is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_disjointness() directly. + + YANG Description: The type of resource disjointness. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-path-disjointness', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """disjointness must be of a type compatible with te-types:te-path-disjointness""", + 'defined-type': "te-types:te-path-disjointness", + 'generated-type': """YANGDynClass(base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-path-disjointness', is_config=True)""", + }) + + self.__disjointness = t + if hasattr(self, '_set'): + self._set() + + def _unset_disjointness(self): + self.__disjointness = YANGDynClass(base=YANGBitsType(allowed_bits={'node': '0', 'link': '1', 'srlg': '2'}), is_leaf=True, yang_name="disjointness", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-path-disjointness', is_config=True) + + id = __builtin__.property(_get_id, _set_id) + disjointness = __builtin__.property(_get_disjointness, _set_disjointness) + + + _pyangbind_elements = OrderedDict([('id', id), ('disjointness', disjointness), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/te_topology_identifier/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/te_topology_identifier/__init__.py new file mode 100644 index 000000000..0e29c5c0c --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/network/te_topology_identifier/__init__.py @@ -0,0 +1,205 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class te_topology_identifier(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/network/te-topology-identifier. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: TE topology identifier container. + """ + __slots__ = ('_path_helper', '_extmethods', '__provider_id','__client_id','__topology_id',) + + _yang_name = 'te-topology-identifier' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__provider_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(0), is_leaf=True, yang_name="provider-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-global-id', is_config=True) + self.__client_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(0), is_leaf=True, yang_name="client-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-global-id', is_config=True) + self.__topology_id = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['0']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([a-zA-Z0-9\\-_.]+:)*/?([a-zA-Z0-9\\-_.]+)(/[a-zA-Z0-9\\-_.]+)*'}),], default=six.text_type(""), is_leaf=True, yang_name="topology-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-topology-id', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'network', 'te-topology-identifier'] + + def _get_provider_id(self): + """ + Getter method for provider_id, mapped from YANG variable /networks/network/te_topology_identifier/provider_id (te-global-id) + + YANG Description: An identifier to uniquely identify a provider. +If omitted, it assumes that the topology provider ID +value = 0 (the default). + """ + return self.__provider_id + + def _set_provider_id(self, v, load=False): + """ + Setter method for provider_id, mapped from YANG variable /networks/network/te_topology_identifier/provider_id (te-global-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_provider_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_provider_id() directly. + + YANG Description: An identifier to uniquely identify a provider. +If omitted, it assumes that the topology provider ID +value = 0 (the default). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(0), is_leaf=True, yang_name="provider-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-global-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """provider_id must be of a type compatible with te-global-id""", + 'defined-type': "ietf-te-topology:te-global-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(0), is_leaf=True, yang_name="provider-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-global-id', is_config=True)""", + }) + + self.__provider_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_provider_id(self): + self.__provider_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(0), is_leaf=True, yang_name="provider-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-global-id', is_config=True) + + + def _get_client_id(self): + """ + Getter method for client_id, mapped from YANG variable /networks/network/te_topology_identifier/client_id (te-global-id) + + YANG Description: An identifier to uniquely identify a client. +If omitted, it assumes that the topology client ID +value = 0 (the default). + """ + return self.__client_id + + def _set_client_id(self, v, load=False): + """ + Setter method for client_id, mapped from YANG variable /networks/network/te_topology_identifier/client_id (te-global-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_client_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_client_id() directly. + + YANG Description: An identifier to uniquely identify a client. +If omitted, it assumes that the topology client ID +value = 0 (the default). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(0), is_leaf=True, yang_name="client-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-global-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """client_id must be of a type compatible with te-global-id""", + 'defined-type': "ietf-te-topology:te-global-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(0), is_leaf=True, yang_name="client-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-global-id', is_config=True)""", + }) + + self.__client_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_client_id(self): + self.__client_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(0), is_leaf=True, yang_name="client-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-global-id', is_config=True) + + + def _get_topology_id(self): + """ + Getter method for topology_id, mapped from YANG variable /networks/network/te_topology_identifier/topology_id (te-topology-id) + + YANG Description: When the datastore contains several topologies, +'topology-id' distinguishes between them. If omitted, +the default (empty) string for this leaf is assumed. + """ + return self.__topology_id + + def _set_topology_id(self, v, load=False): + """ + Setter method for topology_id, mapped from YANG variable /networks/network/te_topology_identifier/topology_id (te-topology-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_topology_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_topology_id() directly. + + YANG Description: When the datastore contains several topologies, +'topology-id' distinguishes between them. If omitted, +the default (empty) string for this leaf is assumed. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['0']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([a-zA-Z0-9\\-_.]+:)*/?([a-zA-Z0-9\\-_.]+)(/[a-zA-Z0-9\\-_.]+)*'}),], default=six.text_type(""), is_leaf=True, yang_name="topology-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-topology-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """topology_id must be of a type compatible with te-topology-id""", + 'defined-type': "ietf-te-topology:te-topology-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['0']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([a-zA-Z0-9\\-_.]+:)*/?([a-zA-Z0-9\\-_.]+)(/[a-zA-Z0-9\\-_.]+)*'}),], default=six.text_type(""), is_leaf=True, yang_name="topology-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-topology-id', is_config=True)""", + }) + + self.__topology_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_topology_id(self): + self.__topology_id = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={'length': ['0']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([a-zA-Z0-9\\-_.]+:)*/?([a-zA-Z0-9\\-_.]+)(/[a-zA-Z0-9\\-_.]+)*'}),], default=six.text_type(""), is_leaf=True, yang_name="topology-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-topology-id', is_config=True) + + provider_id = __builtin__.property(_get_provider_id, _set_provider_id) + client_id = __builtin__.property(_get_client_id, _set_client_id) + topology_id = __builtin__.property(_get_topology_id, _set_topology_id) + + + _pyangbind_elements = OrderedDict([('provider_id', provider_id), ('client_id', client_id), ('topology_id', topology_id), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/__init__.py new file mode 100644 index 000000000..f38ba7bb8 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import templates +class te(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Indicates TE support. + """ + __slots__ = ('_path_helper', '_extmethods', '__templates',) + + _yang_name = 'te' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__templates = YANGDynClass(base=templates.templates, is_container='container', yang_name="templates", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te'] + + def _get_templates(self): + """ + Getter method for templates, mapped from YANG variable /networks/te/templates (container) + + YANG Description: Configuration parameters for templates used for a TE +topology. + """ + return self.__templates + + def _set_templates(self, v, load=False): + """ + Setter method for templates, mapped from YANG variable /networks/te/templates (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_templates is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_templates() directly. + + YANG Description: Configuration parameters for templates used for a TE +topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=templates.templates, is_container='container', yang_name="templates", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """templates must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=templates.templates, is_container='container', yang_name="templates", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__templates = t + if hasattr(self, '_set'): + self._set() + + def _unset_templates(self): + self.__templates = YANGDynClass(base=templates.templates, is_container='container', yang_name="templates", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + templates = __builtin__.property(_get_templates, _set_templates) + + + _pyangbind_elements = OrderedDict([('templates', templates), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/__init__.py new file mode 100644 index 000000000..645419914 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/__init__.py @@ -0,0 +1,161 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import node_template +from . import link_template +class templates(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Configuration parameters for templates used for a TE +topology. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_template','__link_template',) + + _yang_name = 'templates' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_template = YANGDynClass(base=YANGListType("name",node_template.node_template, yang_name="node-template", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="node-template", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + self.__link_template = YANGDynClass(base=YANGListType("name",link_template.link_template, yang_name="link-template", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="link-template", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates'] + + def _get_node_template(self): + """ + Getter method for node_template, mapped from YANG variable /networks/te/templates/node_template (list) + + YANG Description: The list of TE node templates used to define sharable +and reusable TE node attributes. + """ + return self.__node_template + + def _set_node_template(self, v, load=False): + """ + Setter method for node_template, mapped from YANG variable /networks/te/templates/node_template (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_template is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_template() directly. + + YANG Description: The list of TE node templates used to define sharable +and reusable TE node attributes. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("name",node_template.node_template, yang_name="node-template", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="node-template", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_template must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("name",node_template.node_template, yang_name="node-template", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="node-template", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__node_template = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_template(self): + self.__node_template = YANGDynClass(base=YANGListType("name",node_template.node_template, yang_name="node-template", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="node-template", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + + def _get_link_template(self): + """ + Getter method for link_template, mapped from YANG variable /networks/te/templates/link_template (list) + + YANG Description: The list of TE link templates used to define sharable +and reusable TE link attributes. + """ + return self.__link_template + + def _set_link_template(self, v, load=False): + """ + Setter method for link_template, mapped from YANG variable /networks/te/templates/link_template (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_template is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_template() directly. + + YANG Description: The list of TE link templates used to define sharable +and reusable TE link attributes. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("name",link_template.link_template, yang_name="link-template", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="link-template", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_template must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("name",link_template.link_template, yang_name="link-template", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="link-template", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__link_template = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_template(self): + self.__link_template = YANGDynClass(base=YANGListType("name",link_template.link_template, yang_name="link-template", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="link-template", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + node_template = __builtin__.property(_get_node_template, _set_node_template) + link_template = __builtin__.property(_get_link_template, _set_link_template) + + + _pyangbind_elements = OrderedDict([('node_template', node_template), ('link_template', link_template), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/__init__.py new file mode 100644 index 000000000..132c4dbd3 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/__init__.py @@ -0,0 +1,251 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_link_attributes +class link_template(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The list of TE link templates used to define sharable +and reusable TE link attributes. + """ + __slots__ = ('_path_helper', '_extmethods', '__name','__priority','__reference_change_policy','__te_link_attributes',) + + _yang_name = 'link-template' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '/?([a-zA-Z0-9\\-_.]+)(/[a-zA-Z0-9\\-_.]+)*'}), is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-template-name', is_config=True) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=True) + self.__reference_change_policy = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'no-action': {}, 'not-allowed': {}, 'cascade': {}},), is_leaf=True, yang_name="reference-change-policy", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + self.__te_link_attributes = YANGDynClass(base=te_link_attributes.te_link_attributes, is_container='container', yang_name="te-link-attributes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /networks/te/templates/link_template/name (te-types:te-template-name) + + YANG Description: The name to identify a TE link template. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /networks/te/templates/link_template/name (te-types:te-template-name) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: The name to identify a TE link template. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '/?([a-zA-Z0-9\\-_.]+)(/[a-zA-Z0-9\\-_.]+)*'}), is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-template-name', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with te-types:te-template-name""", + 'defined-type': "te-types:te-template-name", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '/?([a-zA-Z0-9\\-_.]+)(/[a-zA-Z0-9\\-_.]+)*'}), is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-template-name', is_config=True)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '/?([a-zA-Z0-9\\-_.]+)(/[a-zA-Z0-9\\-_.]+)*'}), is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-template-name', is_config=True) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/te/templates/link_template/priority (uint16) + + YANG Description: The preference value for resolving conflicts between +different templates. When two or more templates specify +values for one configuration attribute, the value from the +template with the highest priority is used. +A lower number indicates a higher priority. The highest +priority is 0. + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/te/templates/link_template/priority (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: The preference value for resolving conflicts between +different templates. When two or more templates specify +values for one configuration attribute, the value from the +template with the highest priority is used. +A lower number indicates a higher priority. The highest +priority is 0. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=True)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=True) + + + def _get_reference_change_policy(self): + """ + Getter method for reference_change_policy, mapped from YANG variable /networks/te/templates/link_template/reference_change_policy (enumeration) + + YANG Description: This attribute specifies the action taken for a +configuration node that has a reference to this template. + """ + return self.__reference_change_policy + + def _set_reference_change_policy(self, v, load=False): + """ + Setter method for reference_change_policy, mapped from YANG variable /networks/te/templates/link_template/reference_change_policy (enumeration) + If this variable is read-only (config: false) in the + source YANG file, then _set_reference_change_policy is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_reference_change_policy() directly. + + YANG Description: This attribute specifies the action taken for a +configuration node that has a reference to this template. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'no-action': {}, 'not-allowed': {}, 'cascade': {}},), is_leaf=True, yang_name="reference-change-policy", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """reference_change_policy must be of a type compatible with enumeration""", + 'defined-type': "ietf-te-topology:enumeration", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'no-action': {}, 'not-allowed': {}, 'cascade': {}},), is_leaf=True, yang_name="reference-change-policy", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True)""", + }) + + self.__reference_change_policy = t + if hasattr(self, '_set'): + self._set() + + def _unset_reference_change_policy(self): + self.__reference_change_policy = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'no-action': {}, 'not-allowed': {}, 'cascade': {}},), is_leaf=True, yang_name="reference-change-policy", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + + + def _get_te_link_attributes(self): + """ + Getter method for te_link_attributes, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes (container) + + YANG Description: Link attributes in a TE topology. + """ + return self.__te_link_attributes + + def _set_te_link_attributes(self, v, load=False): + """ + Setter method for te_link_attributes, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_link_attributes is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_link_attributes() directly. + + YANG Description: Link attributes in a TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_link_attributes.te_link_attributes, is_container='container', yang_name="te-link-attributes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_link_attributes must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_link_attributes.te_link_attributes, is_container='container', yang_name="te-link-attributes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_link_attributes = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_link_attributes(self): + self.__te_link_attributes = YANGDynClass(base=te_link_attributes.te_link_attributes, is_container='container', yang_name="te-link-attributes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + name = __builtin__.property(_get_name, _set_name) + priority = __builtin__.property(_get_priority, _set_priority) + reference_change_policy = __builtin__.property(_get_reference_change_policy, _set_reference_change_policy) + te_link_attributes = __builtin__.property(_get_te_link_attributes, _set_te_link_attributes) + + + _pyangbind_elements = OrderedDict([('name', name), ('priority', priority), ('reference_change_policy', reference_change_policy), ('te_link_attributes', te_link_attributes), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/__init__.py new file mode 100644 index 000000000..b694dcce0 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/__init__.py @@ -0,0 +1,858 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import external_domain +from . import underlay +from . import interface_switching_capability +from . import label_restrictions +from . import max_link_bandwidth +from . import max_resv_link_bandwidth +from . import unreserved_bandwidth +from . import te_srlgs +from . import te_nsrlgs +class te_link_attributes(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Link attributes in a TE topology. + """ + __slots__ = ('_path_helper', '_extmethods', '__access_type','__external_domain','__is_abstract','__name','__underlay','__admin_status','__link_index','__administrative_group','__interface_switching_capability','__label_restrictions','__link_protection_type','__max_link_bandwidth','__max_resv_link_bandwidth','__unreserved_bandwidth','__te_default_metric','__te_delay_metric','__te_igp_metric','__te_srlgs','__te_nsrlgs',) + + _yang_name = 'te-link-attributes' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__access_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'point-to-point': {}, 'multi-access': {}},), is_leaf=True, yang_name="access-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-link-access-type', is_config=True) + self.__external_domain = YANGDynClass(base=external_domain.external_domain, is_container='container', yang_name="external-domain", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__is_abstract = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-abstract", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=True) + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + self.__underlay = YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__admin_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True) + self.__link_index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="link-index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=True) + self.__administrative_group = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], is_leaf=True, yang_name="administrative-group", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:admin-groups', is_config=True) + self.__interface_switching_capability = YANGDynClass(base=YANGListType("switching_capability encoding",interface_switching_capability.interface_switching_capability, yang_name="interface-switching-capability", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='switching-capability encoding', extensions=None), is_container='list', yang_name="interface-switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + self.__label_restrictions = YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__link_protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="link-protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__max_link_bandwidth = YANGDynClass(base=max_link_bandwidth.max_link_bandwidth, is_container='container', yang_name="max-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__max_resv_link_bandwidth = YANGDynClass(base=max_resv_link_bandwidth.max_resv_link_bandwidth, is_container='container', yang_name="max-resv-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__unreserved_bandwidth = YANGDynClass(base=YANGListType("priority",unreserved_bandwidth.unreserved_bandwidth, yang_name="unreserved-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="unreserved-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + self.__te_default_metric = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-default-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__te_delay_metric = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-delay-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__te_igp_metric = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-igp-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__te_srlgs = YANGDynClass(base=te_srlgs.te_srlgs, is_container='container', yang_name="te-srlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__te_nsrlgs = YANGDynClass(base=te_nsrlgs.te_nsrlgs, is_container='container', yang_name="te-nsrlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes'] + + def _get_access_type(self): + """ + Getter method for access_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/access_type (te-types:te-link-access-type) + + YANG Description: Link access type, which can be point-to-point or +multi-access. + """ + return self.__access_type + + def _set_access_type(self, v, load=False): + """ + Setter method for access_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/access_type (te-types:te-link-access-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_access_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_access_type() directly. + + YANG Description: Link access type, which can be point-to-point or +multi-access. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'point-to-point': {}, 'multi-access': {}},), is_leaf=True, yang_name="access-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-link-access-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """access_type must be of a type compatible with te-types:te-link-access-type""", + 'defined-type': "te-types:te-link-access-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'point-to-point': {}, 'multi-access': {}},), is_leaf=True, yang_name="access-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-link-access-type', is_config=True)""", + }) + + self.__access_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_access_type(self): + self.__access_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'point-to-point': {}, 'multi-access': {}},), is_leaf=True, yang_name="access-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-link-access-type', is_config=True) + + + def _get_external_domain(self): + """ + Getter method for external_domain, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/external_domain (container) + + YANG Description: For an inter-domain link, specifies the attributes of +the remote end of the link, to facilitate the signaling at +the local end. + """ + return self.__external_domain + + def _set_external_domain(self, v, load=False): + """ + Setter method for external_domain, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/external_domain (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_external_domain is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_external_domain() directly. + + YANG Description: For an inter-domain link, specifies the attributes of +the remote end of the link, to facilitate the signaling at +the local end. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=external_domain.external_domain, is_container='container', yang_name="external-domain", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """external_domain must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=external_domain.external_domain, is_container='container', yang_name="external-domain", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__external_domain = t + if hasattr(self, '_set'): + self._set() + + def _unset_external_domain(self): + self.__external_domain = YANGDynClass(base=external_domain.external_domain, is_container='container', yang_name="external-domain", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_is_abstract(self): + """ + Getter method for is_abstract, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/is_abstract (empty) + + YANG Description: Present if the link is abstract. + """ + return self.__is_abstract + + def _set_is_abstract(self, v, load=False): + """ + Setter method for is_abstract, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/is_abstract (empty) + If this variable is read-only (config: false) in the + source YANG file, then _set_is_abstract is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_is_abstract() directly. + + YANG Description: Present if the link is abstract. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="is-abstract", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """is_abstract must be of a type compatible with empty""", + 'defined-type': "empty", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-abstract", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=True)""", + }) + + self.__is_abstract = t + if hasattr(self, '_set'): + self._set() + + def _unset_is_abstract(self): + self.__is_abstract = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-abstract", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=True) + + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/name (string) + + YANG Description: Link name. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: Link name. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + + def _get_underlay(self): + """ + Getter method for underlay, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay (container) + + YANG Description: Attributes of the TE link underlay. + """ + return self.__underlay + + def _set_underlay(self, v, load=False): + """ + Setter method for underlay, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_underlay is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_underlay() directly. + + YANG Description: Attributes of the TE link underlay. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """underlay must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__underlay = t + if hasattr(self, '_set'): + self._set() + + def _unset_underlay(self): + self.__underlay = YANGDynClass(base=underlay.underlay, is_container='container', yang_name="underlay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_admin_status(self): + """ + Getter method for admin_status, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/admin_status (te-types:te-admin-status) + + YANG Description: The administrative state of the link. + """ + return self.__admin_status + + def _set_admin_status(self, v, load=False): + """ + Setter method for admin_status, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/admin_status (te-types:te-admin-status) + If this variable is read-only (config: false) in the + source YANG file, then _set_admin_status is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_admin_status() directly. + + YANG Description: The administrative state of the link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """admin_status must be of a type compatible with te-types:te-admin-status""", + 'defined-type': "te-types:te-admin-status", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True)""", + }) + + self.__admin_status = t + if hasattr(self, '_set'): + self._set() + + def _unset_admin_status(self): + self.__admin_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True) + + + def _get_link_index(self): + """ + Getter method for link_index, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/link_index (uint64) + + YANG Description: The link identifier. If OSPF is used, this object +represents an ospfLsdbID. If IS-IS is used, this object +represents an isisLSPID. If a locally configured link is +used, this object represents a unique value, which is +locally defined in a router. + """ + return self.__link_index + + def _set_link_index(self, v, load=False): + """ + Setter method for link_index, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/link_index (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_index() directly. + + YANG Description: The link identifier. If OSPF is used, this object +represents an ospfLsdbID. If IS-IS is used, this object +represents an isisLSPID. If a locally configured link is +used, this object represents a unique value, which is +locally defined in a router. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="link-index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_index must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="link-index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__link_index = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_index(self): + self.__link_index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="link-index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint64', is_config=True) + + + def _get_administrative_group(self): + """ + Getter method for administrative_group, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/administrative_group (te-types:admin-groups) + + YANG Description: Administrative group or color of the link. +This attribute covers both administrative groups (defined +in RFCs 3630 and 5305) and Extended Administrative Groups +(defined in RFC 7308). + """ + return self.__administrative_group + + def _set_administrative_group(self, v, load=False): + """ + Setter method for administrative_group, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/administrative_group (te-types:admin-groups) + If this variable is read-only (config: false) in the + source YANG file, then _set_administrative_group is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_administrative_group() directly. + + YANG Description: Administrative group or color of the link. +This attribute covers both administrative groups (defined +in RFCs 3630 and 5305) and Extended Administrative Groups +(defined in RFC 7308). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], is_leaf=True, yang_name="administrative-group", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:admin-groups', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """administrative_group must be of a type compatible with te-types:admin-groups""", + 'defined-type': "te-types:admin-groups", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], is_leaf=True, yang_name="administrative-group", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:admin-groups', is_config=True)""", + }) + + self.__administrative_group = t + if hasattr(self, '_set'): + self._set() + + def _unset_administrative_group(self): + self.__administrative_group = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), restriction_dict={'length': ['1..11']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}),], is_leaf=True, yang_name="administrative-group", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:admin-groups', is_config=True) + + + def _get_interface_switching_capability(self): + """ + Getter method for interface_switching_capability, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/interface_switching_capability (list) + + YANG Description: List of ISCDs for this link. + """ + return self.__interface_switching_capability + + def _set_interface_switching_capability(self, v, load=False): + """ + Setter method for interface_switching_capability, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/interface_switching_capability (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_interface_switching_capability is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_interface_switching_capability() directly. + + YANG Description: List of ISCDs for this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("switching_capability encoding",interface_switching_capability.interface_switching_capability, yang_name="interface-switching-capability", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='switching-capability encoding', extensions=None), is_container='list', yang_name="interface-switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """interface_switching_capability must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("switching_capability encoding",interface_switching_capability.interface_switching_capability, yang_name="interface-switching-capability", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='switching-capability encoding', extensions=None), is_container='list', yang_name="interface-switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__interface_switching_capability = t + if hasattr(self, '_set'): + self._set() + + def _unset_interface_switching_capability(self): + self.__interface_switching_capability = YANGDynClass(base=YANGListType("switching_capability encoding",interface_switching_capability.interface_switching_capability, yang_name="interface-switching-capability", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='switching-capability encoding', extensions=None), is_container='list', yang_name="interface-switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + + def _get_label_restrictions(self): + """ + Getter method for label_restrictions, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions (container) + + YANG Description: The label restrictions container. + """ + return self.__label_restrictions + + def _set_label_restrictions(self, v, load=False): + """ + Setter method for label_restrictions, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_restrictions is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_restrictions() directly. + + YANG Description: The label restrictions container. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_restrictions must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_restrictions = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_restrictions(self): + self.__label_restrictions = YANGDynClass(base=label_restrictions.label_restrictions, is_container='container', yang_name="label-restrictions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_link_protection_type(self): + """ + Getter method for link_protection_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/link_protection_type (identityref) + + YANG Description: Link Protection Type desired for this link. + """ + return self.__link_protection_type + + def _set_link_protection_type(self, v, load=False): + """ + Setter method for link_protection_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/link_protection_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_protection_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_protection_type() directly. + + YANG Description: Link Protection Type desired for this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="link-protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_protection_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="link-protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__link_protection_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_protection_type(self): + self.__link_protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-shared': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:link-protection-enhanced': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="link-protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_max_link_bandwidth(self): + """ + Getter method for max_link_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_link_bandwidth (container) + + YANG Description: Maximum bandwidth that can be seen on this link in this +direction. Units are in bytes per second. + """ + return self.__max_link_bandwidth + + def _set_max_link_bandwidth(self, v, load=False): + """ + Setter method for max_link_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_link_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_max_link_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_max_link_bandwidth() directly. + + YANG Description: Maximum bandwidth that can be seen on this link in this +direction. Units are in bytes per second. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=max_link_bandwidth.max_link_bandwidth, is_container='container', yang_name="max-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """max_link_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=max_link_bandwidth.max_link_bandwidth, is_container='container', yang_name="max-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__max_link_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_max_link_bandwidth(self): + self.__max_link_bandwidth = YANGDynClass(base=max_link_bandwidth.max_link_bandwidth, is_container='container', yang_name="max-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_max_resv_link_bandwidth(self): + """ + Getter method for max_resv_link_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth (container) + + YANG Description: Maximum amount of bandwidth that can be reserved in this +direction in this link. Units are in bytes per second. + """ + return self.__max_resv_link_bandwidth + + def _set_max_resv_link_bandwidth(self, v, load=False): + """ + Setter method for max_resv_link_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_max_resv_link_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_max_resv_link_bandwidth() directly. + + YANG Description: Maximum amount of bandwidth that can be reserved in this +direction in this link. Units are in bytes per second. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=max_resv_link_bandwidth.max_resv_link_bandwidth, is_container='container', yang_name="max-resv-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """max_resv_link_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=max_resv_link_bandwidth.max_resv_link_bandwidth, is_container='container', yang_name="max-resv-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__max_resv_link_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_max_resv_link_bandwidth(self): + self.__max_resv_link_bandwidth = YANGDynClass(base=max_resv_link_bandwidth.max_resv_link_bandwidth, is_container='container', yang_name="max-resv-link-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_unreserved_bandwidth(self): + """ + Getter method for unreserved_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth (list) + + YANG Description: Unreserved bandwidth for priority levels 0-7. Units are in +bytes per second. + """ + return self.__unreserved_bandwidth + + def _set_unreserved_bandwidth(self, v, load=False): + """ + Setter method for unreserved_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_unreserved_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unreserved_bandwidth() directly. + + YANG Description: Unreserved bandwidth for priority levels 0-7. Units are in +bytes per second. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("priority",unreserved_bandwidth.unreserved_bandwidth, yang_name="unreserved-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="unreserved-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unreserved_bandwidth must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("priority",unreserved_bandwidth.unreserved_bandwidth, yang_name="unreserved-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="unreserved-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__unreserved_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_unreserved_bandwidth(self): + self.__unreserved_bandwidth = YANGDynClass(base=YANGListType("priority",unreserved_bandwidth.unreserved_bandwidth, yang_name="unreserved-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="unreserved-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + + def _get_te_default_metric(self): + """ + Getter method for te_default_metric, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/te_default_metric (uint32) + + YANG Description: Traffic Engineering metric. + """ + return self.__te_default_metric + + def _set_te_default_metric(self, v, load=False): + """ + Setter method for te_default_metric, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/te_default_metric (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_default_metric is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_default_metric() directly. + + YANG Description: Traffic Engineering metric. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-default-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_default_metric must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-default-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__te_default_metric = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_default_metric(self): + self.__te_default_metric = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-default-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_te_delay_metric(self): + """ + Getter method for te_delay_metric, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/te_delay_metric (uint32) + + YANG Description: Traffic Engineering delay metric. + """ + return self.__te_delay_metric + + def _set_te_delay_metric(self, v, load=False): + """ + Setter method for te_delay_metric, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/te_delay_metric (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_delay_metric is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_delay_metric() directly. + + YANG Description: Traffic Engineering delay metric. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-delay-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_delay_metric must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-delay-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__te_delay_metric = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_delay_metric(self): + self.__te_delay_metric = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-delay-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_te_igp_metric(self): + """ + Getter method for te_igp_metric, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/te_igp_metric (uint32) + + YANG Description: IGP metric used for Traffic Engineering. + """ + return self.__te_igp_metric + + def _set_te_igp_metric(self, v, load=False): + """ + Setter method for te_igp_metric, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/te_igp_metric (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_igp_metric is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_igp_metric() directly. + + YANG Description: IGP metric used for Traffic Engineering. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-igp-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_igp_metric must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-igp-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__te_igp_metric = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_igp_metric(self): + self.__te_igp_metric = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="te-igp-metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_te_srlgs(self): + """ + Getter method for te_srlgs, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/te_srlgs (container) + + YANG Description: Contains a list of SRLGs. + """ + return self.__te_srlgs + + def _set_te_srlgs(self, v, load=False): + """ + Setter method for te_srlgs, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/te_srlgs (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_srlgs is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_srlgs() directly. + + YANG Description: Contains a list of SRLGs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_srlgs.te_srlgs, is_container='container', yang_name="te-srlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_srlgs must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_srlgs.te_srlgs, is_container='container', yang_name="te-srlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_srlgs = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_srlgs(self): + self.__te_srlgs = YANGDynClass(base=te_srlgs.te_srlgs, is_container='container', yang_name="te-srlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_te_nsrlgs(self): + """ + Getter method for te_nsrlgs, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/te_nsrlgs (container) + + YANG Description: Contains a list of NSRLGs (Non-Shared Risk Link Groups). +When an abstract TE link is configured, this list specifies +the request that underlay TE paths need to be mutually +disjoint with other TE links in the same groups. + """ + return self.__te_nsrlgs + + def _set_te_nsrlgs(self, v, load=False): + """ + Setter method for te_nsrlgs, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/te_nsrlgs (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_nsrlgs is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_nsrlgs() directly. + + YANG Description: Contains a list of NSRLGs (Non-Shared Risk Link Groups). +When an abstract TE link is configured, this list specifies +the request that underlay TE paths need to be mutually +disjoint with other TE links in the same groups. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_nsrlgs.te_nsrlgs, is_container='container', yang_name="te-nsrlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_nsrlgs must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_nsrlgs.te_nsrlgs, is_container='container', yang_name="te-nsrlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_nsrlgs = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_nsrlgs(self): + self.__te_nsrlgs = YANGDynClass(base=te_nsrlgs.te_nsrlgs, is_container='container', yang_name="te-nsrlgs", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + access_type = __builtin__.property(_get_access_type, _set_access_type) + external_domain = __builtin__.property(_get_external_domain, _set_external_domain) + is_abstract = __builtin__.property(_get_is_abstract, _set_is_abstract) + name = __builtin__.property(_get_name, _set_name) + underlay = __builtin__.property(_get_underlay, _set_underlay) + admin_status = __builtin__.property(_get_admin_status, _set_admin_status) + link_index = __builtin__.property(_get_link_index, _set_link_index) + administrative_group = __builtin__.property(_get_administrative_group, _set_administrative_group) + interface_switching_capability = __builtin__.property(_get_interface_switching_capability, _set_interface_switching_capability) + label_restrictions = __builtin__.property(_get_label_restrictions, _set_label_restrictions) + link_protection_type = __builtin__.property(_get_link_protection_type, _set_link_protection_type) + max_link_bandwidth = __builtin__.property(_get_max_link_bandwidth, _set_max_link_bandwidth) + max_resv_link_bandwidth = __builtin__.property(_get_max_resv_link_bandwidth, _set_max_resv_link_bandwidth) + unreserved_bandwidth = __builtin__.property(_get_unreserved_bandwidth, _set_unreserved_bandwidth) + te_default_metric = __builtin__.property(_get_te_default_metric, _set_te_default_metric) + te_delay_metric = __builtin__.property(_get_te_delay_metric, _set_te_delay_metric) + te_igp_metric = __builtin__.property(_get_te_igp_metric, _set_te_igp_metric) + te_srlgs = __builtin__.property(_get_te_srlgs, _set_te_srlgs) + te_nsrlgs = __builtin__.property(_get_te_nsrlgs, _set_te_nsrlgs) + + + _pyangbind_elements = OrderedDict([('access_type', access_type), ('external_domain', external_domain), ('is_abstract', is_abstract), ('name', name), ('underlay', underlay), ('admin_status', admin_status), ('link_index', link_index), ('administrative_group', administrative_group), ('interface_switching_capability', interface_switching_capability), ('label_restrictions', label_restrictions), ('link_protection_type', link_protection_type), ('max_link_bandwidth', max_link_bandwidth), ('max_resv_link_bandwidth', max_resv_link_bandwidth), ('unreserved_bandwidth', unreserved_bandwidth), ('te_default_metric', te_default_metric), ('te_delay_metric', te_delay_metric), ('te_igp_metric', te_igp_metric), ('te_srlgs', te_srlgs), ('te_nsrlgs', te_nsrlgs), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/external_domain/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/external_domain/__init__.py new file mode 100644 index 000000000..9d40db380 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/external_domain/__init__.py @@ -0,0 +1,205 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class external_domain(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/external-domain. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: For an inter-domain link, specifies the attributes of +the remote end of the link, to facilitate the signaling at +the local end. + """ + __slots__ = ('_path_helper', '_extmethods', '__network_ref','__remote_te_node_id','__remote_te_link_tp_id',) + + _yang_name = 'external-domain' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + self.__remote_te_node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="remote-te-node-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-node-id', is_config=True) + self.__remote_te_link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="remote-te-link-tp-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-tp-id', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'external-domain'] + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/external_domain/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/external_domain/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + + def _get_remote_te_node_id(self): + """ + Getter method for remote_te_node_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/external_domain/remote_te_node_id (te-types:te-node-id) + + YANG Description: Remote TE node identifier, used together with +'remote-te-link-tp-id' to identify the remote Link +Termination Point (LTP) in a different domain. + """ + return self.__remote_te_node_id + + def _set_remote_te_node_id(self, v, load=False): + """ + Setter method for remote_te_node_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/external_domain/remote_te_node_id (te-types:te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_remote_te_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_remote_te_node_id() directly. + + YANG Description: Remote TE node identifier, used together with +'remote-te-link-tp-id' to identify the remote Link +Termination Point (LTP) in a different domain. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="remote-te-node-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """remote_te_node_id must be of a type compatible with te-types:te-node-id""", + 'defined-type': "te-types:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="remote-te-node-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-node-id', is_config=True)""", + }) + + self.__remote_te_node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_remote_te_node_id(self): + self.__remote_te_node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="remote-te-node-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-node-id', is_config=True) + + + def _get_remote_te_link_tp_id(self): + """ + Getter method for remote_te_link_tp_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/external_domain/remote_te_link_tp_id (te-types:te-tp-id) + + YANG Description: Remote TE LTP identifier, used together with +'remote-te-node-id' to identify the remote LTP in a +different domain. + """ + return self.__remote_te_link_tp_id + + def _set_remote_te_link_tp_id(self, v, load=False): + """ + Setter method for remote_te_link_tp_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/external_domain/remote_te_link_tp_id (te-types:te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_remote_te_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_remote_te_link_tp_id() directly. + + YANG Description: Remote TE LTP identifier, used together with +'remote-te-node-id' to identify the remote LTP in a +different domain. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="remote-te-link-tp-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """remote_te_link_tp_id must be of a type compatible with te-types:te-tp-id""", + 'defined-type': "te-types:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="remote-te-link-tp-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-tp-id', is_config=True)""", + }) + + self.__remote_te_link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_remote_te_link_tp_id(self): + self.__remote_te_link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="remote-te-link-tp-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-tp-id', is_config=True) + + network_ref = __builtin__.property(_get_network_ref, _set_network_ref) + remote_te_node_id = __builtin__.property(_get_remote_te_node_id, _set_remote_te_node_id) + remote_te_link_tp_id = __builtin__.property(_get_remote_te_link_tp_id, _set_remote_te_link_tp_id) + + + _pyangbind_elements = OrderedDict([('network_ref', network_ref), ('remote_te_node_id', remote_te_node_id), ('remote_te_link_tp_id', remote_te_link_tp_id), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/__init__.py new file mode 100644 index 000000000..ce33e949d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/__init__.py @@ -0,0 +1,206 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import max_lsp_bandwidth +class interface_switching_capability(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/interface-switching-capability. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of ISCDs for this link. + """ + __slots__ = ('_path_helper', '_extmethods', '__switching_capability','__encoding','__max_lsp_bandwidth',) + + _yang_name = 'interface-switching-capability' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__switching_capability = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__encoding = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__max_lsp_bandwidth = YANGDynClass(base=YANGListType("priority",max_lsp_bandwidth.max_lsp_bandwidth, yang_name="max-lsp-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="max-lsp-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'interface-switching-capability'] + + def _get_switching_capability(self): + """ + Getter method for switching_capability, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/interface_switching_capability/switching_capability (identityref) + + YANG Description: Switching capability for this interface. + """ + return self.__switching_capability + + def _set_switching_capability(self, v, load=False): + """ + Setter method for switching_capability, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/interface_switching_capability/switching_capability (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_switching_capability is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_switching_capability() directly. + + YANG Description: Switching capability for this interface. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """switching_capability must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__switching_capability = t + if hasattr(self, '_set'): + self._set() + + def _unset_switching_capability(self): + self.__switching_capability = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-psc1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-evpl': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-l2sc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-tdm': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-otn': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-dcsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-lsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:switching-fsc': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="switching-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_encoding(self): + """ + Getter method for encoding, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/interface_switching_capability/encoding (identityref) + + YANG Description: Encoding supported by this interface. + """ + return self.__encoding + + def _set_encoding(self, v, load=False): + """ + Setter method for encoding, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/interface_switching_capability/encoding (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_encoding is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_encoding() directly. + + YANG Description: Encoding supported by this interface. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """encoding must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__encoding = t + if hasattr(self, '_set'): + self._set() + + def _unset_encoding(self): + self.__encoding = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-packet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-ethernet': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-pdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-sdh': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-digital-wrapper': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-lambda': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-fiber-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-oduk': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-optical-channel': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-encoding-line': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="encoding", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_max_lsp_bandwidth(self): + """ + Getter method for max_lsp_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth (list) + + YANG Description: Maximum Label Switched Path (LSP) bandwidth at +priorities 0-7. + """ + return self.__max_lsp_bandwidth + + def _set_max_lsp_bandwidth(self, v, load=False): + """ + Setter method for max_lsp_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_max_lsp_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_max_lsp_bandwidth() directly. + + YANG Description: Maximum Label Switched Path (LSP) bandwidth at +priorities 0-7. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("priority",max_lsp_bandwidth.max_lsp_bandwidth, yang_name="max-lsp-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="max-lsp-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """max_lsp_bandwidth must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("priority",max_lsp_bandwidth.max_lsp_bandwidth, yang_name="max-lsp-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="max-lsp-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__max_lsp_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_max_lsp_bandwidth(self): + self.__max_lsp_bandwidth = YANGDynClass(base=YANGListType("priority",max_lsp_bandwidth.max_lsp_bandwidth, yang_name="max-lsp-bandwidth", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='priority', extensions=None), is_container='list', yang_name="max-lsp-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + switching_capability = __builtin__.property(_get_switching_capability, _set_switching_capability) + encoding = __builtin__.property(_get_encoding, _set_encoding) + max_lsp_bandwidth = __builtin__.property(_get_max_lsp_bandwidth, _set_max_lsp_bandwidth) + + + _pyangbind_elements = OrderedDict([('switching_capability', switching_capability), ('encoding', encoding), ('max_lsp_bandwidth', max_lsp_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/__init__.py new file mode 100644 index 000000000..976aba241 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/__init__.py @@ -0,0 +1,163 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_bandwidth +class max_lsp_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/interface-switching-capability/max-lsp-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Maximum Label Switched Path (LSP) bandwidth at +priorities 0-7. + """ + __slots__ = ('_path_helper', '_extmethods', '__priority','__te_bandwidth',) + + _yang_name = 'max-lsp-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'interface-switching-capability', 'max-lsp-bandwidth'] + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/priority (uint8) + + YANG Description: Priority. + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: Priority. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + + + def _get_te_bandwidth(self): + """ + Getter method for te_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth (container) + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + return self.__te_bandwidth + + def _set_te_bandwidth(self, v, load=False): + """ + Setter method for te_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_bandwidth() directly. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_bandwidth(self): + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + priority = __builtin__.property(_get_priority, _set_priority) + te_bandwidth = __builtin__.property(_get_te_bandwidth, _set_te_bandwidth) + + + _pyangbind_elements = OrderedDict([('priority', priority), ('te_bandwidth', te_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/__init__.py new file mode 100644 index 000000000..f4549d5df --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/__init__.py @@ -0,0 +1,195 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/interface-switching-capability/max-lsp-bandwidth/te-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_bandwidth',) + + _yang_name = 'te-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'interface-switching-capability', 'max-lsp-bandwidth', 'te-bandwidth'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/generic (te-bandwidth) + + YANG Description: Bandwidth specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/generic (te-bandwidth) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Bandwidth specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with te-bandwidth""", + 'defined-type': "ietf-te-topology:te-bandwidth", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn (container) + + YANG Description: Maximum bandwidth attributes for OTN paths. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Maximum bandwidth attributes for OTN paths. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_eth_bandwidth(self): + """ + Getter method for eth_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/eth_bandwidth (uint64) + + YANG Description: Available bandwith value expressed in kilobits per second + """ + return self.__eth_bandwidth + + def _set_eth_bandwidth(self, v, load=False): + """ + Setter method for eth_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/eth_bandwidth (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_bandwidth() directly. + + YANG Description: Available bandwith value expressed in kilobits per second + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_bandwidth must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__eth_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_bandwidth(self): + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + eth_bandwidth = __builtin__.property(_get_eth_bandwidth, _set_eth_bandwidth) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['eth_bandwidth']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_bandwidth', eth_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/__init__.py new file mode 100644 index 000000000..d630e8317 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/__init__.py @@ -0,0 +1,156 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/interface-switching-capability/max-lsp-bandwidth/te-bandwidth/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Maximum bandwidth attributes for OTN paths. + """ + __slots__ = ('_path_helper', '_extmethods', '__odu_type','__max_ts_number',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__max_ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="max-ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'interface-switching-capability', 'max-lsp-bandwidth', 'te-bandwidth', 'otn'] + + def _get_odu_type(self): + """ + Getter method for odu_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/odu_type (identityref) + + YANG Description: ODU type + """ + return self.__odu_type + + def _set_odu_type(self, v, load=False): + """ + Setter method for odu_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/odu_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type() directly. + + YANG Description: ODU type + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__odu_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type(self): + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_max_ts_number(self): + """ + Getter method for max_ts_number, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/max_ts_number (uint16) + + YANG Description: The maximum number of Tributary Slots (TS) that could be +used by an ODUflex LSP. + """ + return self.__max_ts_number + + def _set_max_ts_number(self, v, load=False): + """ + Setter method for max_ts_number, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/interface_switching_capability/max_lsp_bandwidth/te_bandwidth/otn/max_ts_number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_max_ts_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_max_ts_number() directly. + + YANG Description: The maximum number of Tributary Slots (TS) that could be +used by an ODUflex LSP. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="max-ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """max_ts_number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="max-ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__max_ts_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_max_ts_number(self): + self.__max_ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="max-ts-number", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + odu_type = __builtin__.property(_get_odu_type, _set_odu_type) + max_ts_number = __builtin__.property(_get_max_ts_number, _set_max_ts_number) + + __choices__ = {'technology': {'otn': ['odu_type', 'max_ts_number']}} + _pyangbind_elements = OrderedDict([('odu_type', odu_type), ('max_ts_number', max_ts_number), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/__init__.py new file mode 100644 index 000000000..c3f81b42b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/__init__.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import label_restriction +class label_restrictions(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/label-restrictions. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The label restrictions container. + """ + __slots__ = ('_path_helper', '_extmethods', '__label_restriction',) + + _yang_name = 'label-restrictions' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__label_restriction = YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'label-restrictions'] + + def _get_label_restriction(self): + """ + Getter method for label_restriction, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction (list) + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + return self.__label_restriction + + def _set_label_restriction(self, v, load=False): + """ + Setter method for label_restriction, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_restriction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_restriction() directly. + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_restriction must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__label_restriction = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_restriction(self): + self.__label_restriction = YANGDynClass(base=YANGListType("index",label_restriction.label_restriction, yang_name="label-restriction", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="label-restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + label_restriction = __builtin__.property(_get_label_restriction, _set_label_restriction) + + + _pyangbind_elements = OrderedDict([('label_restriction', label_restriction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/__init__.py new file mode 100644 index 000000000..aff15591b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/__init__.py @@ -0,0 +1,450 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import label_start +from . import label_end +from . import label_step +from . import otn_label_range +from . import ethernet_label_range +class label_restriction(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/label-restrictions/label-restriction. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The absence of the label restrictions container implies +that all labels are acceptable; otherwise, only restricted +labels are available. + """ + __slots__ = ('_path_helper', '_extmethods', '__restriction','__index','__label_start','__label_end','__label_step','__range_bitmap','__otn_label_range','__ethernet_label_range',) + + _yang_name = 'label-restriction' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__restriction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__label_start = YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_end = YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_step = YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__range_bitmap = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True) + self.__otn_label_range = YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__ethernet_label_range = YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'label-restrictions', 'label-restriction'] + + def _get_restriction(self): + """ + Getter method for restriction, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/restriction (enumeration) + + YANG Description: Indicates whether the list item is inclusive or exclusive. + """ + return self.__restriction + + def _set_restriction(self, v, load=False): + """ + Setter method for restriction, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/restriction (enumeration) + If this variable is read-only (config: false) in the + source YANG file, then _set_restriction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_restriction() directly. + + YANG Description: Indicates whether the list item is inclusive or exclusive. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """restriction must be of a type compatible with enumeration""", + 'defined-type': "ietf-te-topology:enumeration", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True)""", + }) + + self.__restriction = t + if hasattr(self, '_set'): + self._set() + + def _unset_restriction(self): + self.__restriction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'inclusive': {}, 'exclusive': {}},), default=six.text_type("inclusive"), is_leaf=True, yang_name="restriction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/index (uint32) + + YANG Description: The index of the label restriction list entry. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/index (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: The index of the label restriction list entry. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_label_start(self): + """ + Getter method for label_start, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start (container) + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + return self.__label_start + + def _set_label_start(self, v, load=False): + """ + Setter method for label_start, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_start is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_start() directly. + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_start must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_start = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_start(self): + self.__label_start = YANGDynClass(base=label_start.label_start, is_container='container', yang_name="label-start", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_end(self): + """ + Getter method for label_end, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end (container) + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + return self.__label_end + + def _set_label_end(self, v, load=False): + """ + Setter method for label_end, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_end is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_end() directly. + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_end must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_end = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_end(self): + self.__label_end = YANGDynClass(base=label_end.label_end, is_container='container', yang_name="label-end", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_step(self): + """ + Getter method for label_step, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step (container) + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + return self.__label_step + + def _set_label_step(self, v, load=False): + """ + Setter method for label_step, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_step is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_step() directly. + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_step must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_step = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_step(self): + self.__label_step = YANGDynClass(base=label_step.label_step, is_container='container', yang_name="label-step", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_range_bitmap(self): + """ + Getter method for range_bitmap, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/range_bitmap (yang:hex-string) + + YANG Description: When there are gaps between 'label-start' and 'label-end', +this attribute is used to specify the positions +of the used labels. This is represented in big endian as +'hex-string'. +The most significant byte in the hex-string is the farthest +to the left in the byte sequence. Leading zero bytes in the +configured value may be omitted for brevity. +Each bit position in the 'range-bitmap' 'hex-string' maps +to a label in the range derived from 'label-start'. + +For example, assuming that 'label-start' = 16000 and +'range-bitmap' = 0x01000001, then: + +- bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. +- bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1. + """ + return self.__range_bitmap + + def _set_range_bitmap(self, v, load=False): + """ + Setter method for range_bitmap, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/range_bitmap (yang:hex-string) + If this variable is read-only (config: false) in the + source YANG file, then _set_range_bitmap is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_range_bitmap() directly. + + YANG Description: When there are gaps between 'label-start' and 'label-end', +this attribute is used to specify the positions +of the used labels. This is represented in big endian as +'hex-string'. +The most significant byte in the hex-string is the farthest +to the left in the byte sequence. Leading zero bytes in the +configured value may be omitted for brevity. +Each bit position in the 'range-bitmap' 'hex-string' maps +to a label in the range derived from 'label-start'. + +For example, assuming that 'label-start' = 16000 and +'range-bitmap' = 0x01000001, then: + +- bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. +- bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """range_bitmap must be of a type compatible with yang:hex-string""", + 'defined-type': "yang:hex-string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True)""", + }) + + self.__range_bitmap = t + if hasattr(self, '_set'): + self._set() + + def _unset_range_bitmap(self): + self.__range_bitmap = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'}), is_leaf=True, yang_name="range-bitmap", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='yang:hex-string', is_config=True) + + + def _get_otn_label_range(self): + """ + Getter method for otn_label_range, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/otn_label_range (container) + + YANG Description: Label range information for OTN. + """ + return self.__otn_label_range + + def _set_otn_label_range(self, v, load=False): + """ + Setter method for otn_label_range, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/otn_label_range (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn_label_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn_label_range() directly. + + YANG Description: Label range information for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn_label_range must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn_label_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn_label_range(self): + self.__otn_label_range = YANGDynClass(base=otn_label_range.otn_label_range, is_container='container', yang_name="otn-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_ethernet_label_range(self): + """ + Getter method for ethernet_label_range, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/ethernet_label_range (container) + + YANG Description: Ethernet-specific label range related information. + """ + return self.__ethernet_label_range + + def _set_ethernet_label_range(self, v, load=False): + """ + Setter method for ethernet_label_range, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/ethernet_label_range (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_ethernet_label_range is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ethernet_label_range() directly. + + YANG Description: Ethernet-specific label range related information. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ethernet_label_range must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True)""", + }) + + self.__ethernet_label_range = t + if hasattr(self, '_set'): + self._set() + + def _unset_ethernet_label_range(self): + self.__ethernet_label_range = YANGDynClass(base=ethernet_label_range.ethernet_label_range, is_container='container', yang_name="ethernet-label-range", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='container', is_config=True) + + restriction = __builtin__.property(_get_restriction, _set_restriction) + index = __builtin__.property(_get_index, _set_index) + label_start = __builtin__.property(_get_label_start, _set_label_start) + label_end = __builtin__.property(_get_label_end, _set_label_end) + label_step = __builtin__.property(_get_label_step, _set_label_step) + range_bitmap = __builtin__.property(_get_range_bitmap, _set_range_bitmap) + otn_label_range = __builtin__.property(_get_otn_label_range, _set_otn_label_range) + ethernet_label_range = __builtin__.property(_get_ethernet_label_range, _set_ethernet_label_range) + + + _pyangbind_elements = OrderedDict([('restriction', restriction), ('index', index), ('label_start', label_start), ('label_end', label_end), ('label_step', label_step), ('range_bitmap', range_bitmap), ('otn_label_range', otn_label_range), ('ethernet_label_range', ethernet_label_range), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/ethernet_label_range/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/ethernet_label_range/__init__.py new file mode 100644 index 000000000..eae880f42 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/ethernet_label_range/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class ethernet_label_range(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/label-restrictions/label-restriction/ethernet-label-range. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Ethernet-specific label range related information. + """ + __slots__ = ('_path_helper', '_extmethods', '__tag_type','__priority',) + + _yang_name = 'ethernet-label-range' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tag_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'label-restrictions', 'label-restriction', 'ethernet-label-range'] + + def _get_tag_type(self): + """ + Getter method for tag_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/ethernet_label_range/tag_type (etht-types:eth-tag-type) + + YANG Description: VLAN tag type. + """ + return self.__tag_type + + def _set_tag_type(self, v, load=False): + """ + Setter method for tag_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/ethernet_label_range/tag_type (etht-types:eth-tag-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_tag_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tag_type() directly. + + YANG Description: VLAN tag type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tag_type must be of a type compatible with etht-types:eth-tag-type""", + 'defined-type': "etht-types:eth-tag-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True)""", + }) + + self.__tag_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_tag_type(self): + self.__tag_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:c-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 's-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'ietf-eth-tran-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}, 'etht-types:s-vlan-tag-type': {'@module': 'ietf-eth-tran-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-eth-tran-types'}},), is_leaf=True, yang_name="tag-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:eth-tag-type', is_config=True) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/ethernet_label_range/priority (uint8) + + YANG Description: priority. + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/ethernet_label_range/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: priority. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint8', is_config=True) + + tag_type = __builtin__.property(_get_tag_type, _set_tag_type) + priority = __builtin__.property(_get_priority, _set_priority) + + + _pyangbind_elements = OrderedDict([('tag_type', tag_type), ('priority', priority), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/__init__.py new file mode 100644 index 000000000..e9e68e828 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/__init__.py @@ -0,0 +1,119 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_end(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/label-restrictions/label-restriction/label-end. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This is the ending label if a label range is specified. +This attribute is not set if a single label is specified. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-end' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'label-restrictions', 'label-restriction', 'label-end'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/__init__.py new file mode 100644 index 000000000..1fdead5d2 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/label-restrictions/label-restriction/label-end/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'label-restrictions', 'label-restriction', 'label-end', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/otn (container) + + YANG Description: Label start or label end for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label start or label end for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py new file mode 100644 index 000000000..c0cf47b54 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/otn/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/label-restrictions/label-restriction/label-end/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label start or label end for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'label-restrictions', 'label-restriction', 'label-end', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/otn/ts (otn-ts) + + YANG Description: Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_end/te_label/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + ts = __builtin__.property(_get_ts, _set_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/__init__.py new file mode 100644 index 000000000..c9b398df7 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/__init__.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_start(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/label-restrictions/label-restriction/label-start. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This is the starting label if a label range is specified. +This is the label value if a single label is specified, +in which case the 'label-end' attribute is not set. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-start' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'label-restrictions', 'label-restriction', 'label-start'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/__init__.py new file mode 100644 index 000000000..bbd976bc9 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/label-restrictions/label-restriction/label-start/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'label-restrictions', 'label-restriction', 'label-start', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/otn (container) + + YANG Description: Label start or label end for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label start or label end for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py new file mode 100644 index 000000000..900ca9468 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/otn/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/label-restrictions/label-restriction/label-start/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label start or label end for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'label-restrictions', 'label-restriction', 'label-start', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/otn/ts (otn-ts) + + YANG Description: Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_start/te_label/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + ts = __builtin__.property(_get_ts, _set_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/__init__.py new file mode 100644 index 000000000..8b580328d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/__init__.py @@ -0,0 +1,200 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class label_step(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/label-restrictions/label-restriction/label-step. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The step increment between labels in the label range. +The label start/end values will have to be consistent +with the sign of label step. For example, +'label-start' < 'label-end' enforces 'label-step' > 0 +'label-start' > 'label-end' enforces 'label-step' < 0. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_step',) + + _yang_name = 'label-step' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__eth_step = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'label-restrictions', 'label-restriction', 'label-step'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/generic (int32) + + YANG Description: Label range step. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/generic (int32) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Label range step. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with int32""", + 'defined-type': "int32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['-2147483648..2147483647']}, int_size=32)(1), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='int32', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/otn (container) + + YANG Description: Label step for OTN + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label step for OTN + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_eth_step(self): + """ + Getter method for eth_step, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/eth_step (uint16) + + YANG Description: Label step which represent possible increments for +an Ethernet VLAN tag. + """ + return self.__eth_step + + def _set_eth_step(self, v, load=False): + """ + Setter method for eth_step, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/eth_step (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_step is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_step() directly. + + YANG Description: Label step which represent possible increments for +an Ethernet VLAN tag. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_step must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True)""", + }) + + self.__eth_step = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_step(self): + self.__eth_step = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16)(1), is_leaf=True, yang_name="eth-step", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint16', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + eth_step = __builtin__.property(_get_eth_step, _set_eth_step) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['eth_step']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_step', eth_step), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/otn/__init__.py new file mode 100644 index 000000000..d47950a6b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/otn/__init__.py @@ -0,0 +1,158 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/label-restrictions/label-restriction/label-step/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label step for OTN + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__ts',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'label-restrictions', 'label-restriction', 'label-step', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/otn/tpn (otn-tpn) + + YANG Description: Label step which represents possible increments for +Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Label step which represents possible increments for +Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('range-type', 'trib-port'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_ts(self): + """ + Getter method for ts, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/otn/ts (otn-ts) + + YANG Description: Label step which represents possible increments for +Tributary Slot (TS) number. + """ + return self.__ts + + def _set_ts(self, v, load=False): + """ + Setter method for ts, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/label_step/otn/ts (otn-ts) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts() directly. + + YANG Description: Label step which represents possible increments for +Tributary Slot (TS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts must be of a type compatible with otn-ts""", + 'defined-type': "ietf-otn-topology:otn-ts", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True)""", + }) + + self.__ts = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts(self): + self.__ts = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts", parent=self, choice=('range-type', 'trib-slot'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-ts', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + ts = __builtin__.property(_get_ts, _set_ts) + + __choices__ = {'range-type': {'trib-port': ['tpn'], 'trib-slot': ['ts']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('ts', ts), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/otn_label_range/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/otn_label_range/__init__.py new file mode 100644 index 000000000..2a0404874 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/otn_label_range/__init__.py @@ -0,0 +1,256 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn_label_range(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/label-restrictions/label-restriction/otn-label-range. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label range information for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__range_type','__tsg','__odu_type_list','__priority',) + + _yang_name = 'otn-label-range' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__range_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__odu_type_list = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'label-restrictions', 'label-restriction', 'otn-label-range'] + + def _get_range_type(self): + """ + Getter method for range_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/otn_label_range/range_type (otn-label-range-type) + + YANG Description: The type of range (e.g., TPN or TS) +to which the label range applies + """ + return self.__range_type + + def _set_range_type(self, v, load=False): + """ + Setter method for range_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/otn_label_range/range_type (otn-label-range-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_range_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_range_type() directly. + + YANG Description: The type of range (e.g., TPN or TS) +to which the label range applies + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """range_type must be of a type compatible with otn-label-range-type""", + 'defined-type': "ietf-otn-topology:otn-label-range-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True)""", + }) + + self.__range_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_range_type(self): + self.__range_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'trib-slot': {}, 'trib-port': {}},), is_leaf=True, yang_name="range-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-label-range-type', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/otn_label_range/tsg (identityref) + + YANG Description: Tributary slot granularity (TSG) to which the label range +applies. + +This leaf MUST be present when the range-type is TS. + +This leaf MAY be omitted when mapping an ODUk over an OTUk +Link. In this case the range-type is tpn, with only one +entry (ODUk), and the tpn range has only one value (1). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/otn_label_range/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary slot granularity (TSG) to which the label range +applies. + +This leaf MUST be present when the range-type is TS. + +This leaf MAY be omitted when mapping an ODUk over an OTUk +Link. In this case the range-type is tpn, with only one +entry (ODUk), and the tpn range has only one value (1). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_odu_type_list(self): + """ + Getter method for odu_type_list, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/otn_label_range/odu_type_list (identityref) + + YANG Description: List of ODU types to which the label range applies. + +An Empty odu-type-list means that the label range +applies to all the supported ODU types. + """ + return self.__odu_type_list + + def _set_odu_type_list(self, v, load=False): + """ + Setter method for odu_type_list, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/otn_label_range/odu_type_list (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type_list() directly. + + YANG Description: List of ODU types to which the label range applies. + +An Empty odu-type-list means that the label range +applies to all the supported ODU types. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type_list must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__odu_type_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type_list(self): + self.__odu_type_list = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},)), is_leaf=False, yang_name="odu-type-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/otn_label_range/priority (uint8) + + YANG Description: Priority in Interface Switching Capability +Descriptor (ISCD). + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/label_restrictions/label_restriction/otn_label_range/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: Priority in Interface Switching Capability +Descriptor (ISCD). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint8', is_config=True) + + range_type = __builtin__.property(_get_range_type, _set_range_type) + tsg = __builtin__.property(_get_tsg, _set_tsg) + odu_type_list = __builtin__.property(_get_odu_type_list, _set_odu_type_list) + priority = __builtin__.property(_get_priority, _set_priority) + + + _pyangbind_elements = OrderedDict([('range_type', range_type), ('tsg', tsg), ('odu_type_list', odu_type_list), ('priority', priority), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/__init__.py new file mode 100644 index 000000000..d5fb70e3a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/__init__.py @@ -0,0 +1,119 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_bandwidth +class max_link_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/max-link-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Maximum bandwidth that can be seen on this link in this +direction. Units are in bytes per second. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_bandwidth',) + + _yang_name = 'max-link-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'max-link-bandwidth'] + + def _get_te_bandwidth(self): + """ + Getter method for te_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth (container) + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + return self.__te_bandwidth + + def _set_te_bandwidth(self, v, load=False): + """ + Setter method for te_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_bandwidth() directly. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_bandwidth(self): + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_bandwidth = __builtin__.property(_get_te_bandwidth, _set_te_bandwidth) + + + _pyangbind_elements = OrderedDict([('te_bandwidth', te_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/__init__.py new file mode 100644 index 000000000..1d86069ed --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/__init__.py @@ -0,0 +1,195 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/max-link-bandwidth/te-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_bandwidth',) + + _yang_name = 'te-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'max-link-bandwidth', 'te-bandwidth'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/generic (te-bandwidth) + + YANG Description: Bandwidth specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/generic (te-bandwidth) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Bandwidth specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with te-bandwidth""", + 'defined-type': "ietf-te-topology:te-bandwidth", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/otn (container) + + YANG Description: Bandwidth attributes for OTN links + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Bandwidth attributes for OTN links + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_eth_bandwidth(self): + """ + Getter method for eth_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/eth_bandwidth (uint64) + + YANG Description: Available bandwith value expressed in kilobits per second + """ + return self.__eth_bandwidth + + def _set_eth_bandwidth(self, v, load=False): + """ + Setter method for eth_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/eth_bandwidth (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_bandwidth() directly. + + YANG Description: Available bandwith value expressed in kilobits per second + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_bandwidth must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__eth_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_bandwidth(self): + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + eth_bandwidth = __builtin__.property(_get_eth_bandwidth, _set_eth_bandwidth) + + __choices__ = {'technology': {'generic': ['generic']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_bandwidth', eth_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/__init__.py new file mode 100644 index 000000000..4528f641f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import odulist +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/max-link-bandwidth/te-bandwidth/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Bandwidth attributes for OTN links + """ + __slots__ = ('_path_helper', '_extmethods', '__odulist',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'max-link-bandwidth', 'te-bandwidth', 'otn'] + + def _get_odulist(self): + """ + Getter method for odulist, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist (list) + + YANG Description: OTN bandwidth definition + """ + return self.__odulist + + def _set_odulist(self, v, load=False): + """ + Setter method for odulist, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_odulist is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odulist() directly. + + YANG Description: OTN bandwidth definition + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odulist must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True)""", + }) + + self.__odulist = t + if hasattr(self, '_set'): + self._set() + + def _unset_odulist(self): + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + + odulist = __builtin__.property(_get_odulist, _set_odulist) + + + _pyangbind_elements = OrderedDict([('odulist', odulist), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist/__init__.py new file mode 100644 index 000000000..f17480835 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist/__init__.py @@ -0,0 +1,200 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class odulist(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/max-link-bandwidth/te-bandwidth/otn/odulist. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: OTN bandwidth definition + """ + __slots__ = ('_path_helper', '_extmethods', '__odu_type','__number','__ts_number',) + + _yang_name = 'odulist' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'max-link-bandwidth', 'te-bandwidth', 'otn', 'odulist'] + + def _get_odu_type(self): + """ + Getter method for odu_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist/odu_type (identityref) + + YANG Description: ODU type + """ + return self.__odu_type + + def _set_odu_type(self, v, load=False): + """ + Setter method for odu_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist/odu_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type() directly. + + YANG Description: ODU type + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__odu_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type(self): + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_number(self): + """ + Getter method for number, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist/number (uint16) + + YANG Description: Number of ODUs + """ + return self.__number + + def _set_number(self, v, load=False): + """ + Setter method for number, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist/number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_number() directly. + + YANG Description: Number of ODUs + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__number = t + if hasattr(self, '_set'): + self._set() + + def _unset_number(self): + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + + def _get_ts_number(self): + """ + Getter method for ts_number, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist/ts_number (uint16) + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + return self.__ts_number + + def _set_ts_number(self, v, load=False): + """ + Setter method for ts_number, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_link_bandwidth/te_bandwidth/otn/odulist/ts_number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_number() directly. + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__ts_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_number(self): + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + odu_type = __builtin__.property(_get_odu_type, _set_odu_type) + number = __builtin__.property(_get_number, _set_number) + ts_number = __builtin__.property(_get_ts_number, _set_ts_number) + + + _pyangbind_elements = OrderedDict([('odu_type', odu_type), ('number', number), ('ts_number', ts_number), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/__init__.py new file mode 100644 index 000000000..7f16f359f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/__init__.py @@ -0,0 +1,119 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_bandwidth +class max_resv_link_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/max-resv-link-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Maximum amount of bandwidth that can be reserved in this +direction in this link. Units are in bytes per second. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_bandwidth',) + + _yang_name = 'max-resv-link-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'max-resv-link-bandwidth'] + + def _get_te_bandwidth(self): + """ + Getter method for te_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth (container) + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + return self.__te_bandwidth + + def _set_te_bandwidth(self, v, load=False): + """ + Setter method for te_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_bandwidth() directly. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_bandwidth(self): + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_bandwidth = __builtin__.property(_get_te_bandwidth, _set_te_bandwidth) + + + _pyangbind_elements = OrderedDict([('te_bandwidth', te_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/__init__.py new file mode 100644 index 000000000..f781d9af5 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/__init__.py @@ -0,0 +1,195 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/max-resv-link-bandwidth/te-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_bandwidth',) + + _yang_name = 'te-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'max-resv-link-bandwidth', 'te-bandwidth'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/generic (te-bandwidth) + + YANG Description: Bandwidth specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/generic (te-bandwidth) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Bandwidth specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with te-bandwidth""", + 'defined-type': "ietf-te-topology:te-bandwidth", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn (container) + + YANG Description: Bandwidth attributes for OTN links + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Bandwidth attributes for OTN links + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_eth_bandwidth(self): + """ + Getter method for eth_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/eth_bandwidth (uint64) + + YANG Description: Available bandwith value expressed in kilobits per second + """ + return self.__eth_bandwidth + + def _set_eth_bandwidth(self, v, load=False): + """ + Setter method for eth_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/eth_bandwidth (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_bandwidth() directly. + + YANG Description: Available bandwith value expressed in kilobits per second + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_bandwidth must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__eth_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_bandwidth(self): + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + eth_bandwidth = __builtin__.property(_get_eth_bandwidth, _set_eth_bandwidth) + + __choices__ = {'technology': {'generic': ['generic']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_bandwidth', eth_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/__init__.py new file mode 100644 index 000000000..eee723135 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import odulist +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/max-resv-link-bandwidth/te-bandwidth/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Bandwidth attributes for OTN links + """ + __slots__ = ('_path_helper', '_extmethods', '__odulist',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'max-resv-link-bandwidth', 'te-bandwidth', 'otn'] + + def _get_odulist(self): + """ + Getter method for odulist, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist (list) + + YANG Description: OTN bandwidth definition + """ + return self.__odulist + + def _set_odulist(self, v, load=False): + """ + Setter method for odulist, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_odulist is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odulist() directly. + + YANG Description: OTN bandwidth definition + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odulist must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True)""", + }) + + self.__odulist = t + if hasattr(self, '_set'): + self._set() + + def _unset_odulist(self): + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + + odulist = __builtin__.property(_get_odulist, _set_odulist) + + + _pyangbind_elements = OrderedDict([('odulist', odulist), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist/__init__.py new file mode 100644 index 000000000..98d18da30 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist/__init__.py @@ -0,0 +1,200 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class odulist(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/max-resv-link-bandwidth/te-bandwidth/otn/odulist. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: OTN bandwidth definition + """ + __slots__ = ('_path_helper', '_extmethods', '__odu_type','__number','__ts_number',) + + _yang_name = 'odulist' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'max-resv-link-bandwidth', 'te-bandwidth', 'otn', 'odulist'] + + def _get_odu_type(self): + """ + Getter method for odu_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist/odu_type (identityref) + + YANG Description: ODU type + """ + return self.__odu_type + + def _set_odu_type(self, v, load=False): + """ + Setter method for odu_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist/odu_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type() directly. + + YANG Description: ODU type + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__odu_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type(self): + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_number(self): + """ + Getter method for number, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist/number (uint16) + + YANG Description: Number of ODUs + """ + return self.__number + + def _set_number(self, v, load=False): + """ + Setter method for number, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist/number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_number() directly. + + YANG Description: Number of ODUs + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__number = t + if hasattr(self, '_set'): + self._set() + + def _unset_number(self): + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + + def _get_ts_number(self): + """ + Getter method for ts_number, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist/ts_number (uint16) + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + return self.__ts_number + + def _set_ts_number(self, v, load=False): + """ + Setter method for ts_number, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/max_resv_link_bandwidth/te_bandwidth/otn/odulist/ts_number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_number() directly. + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__ts_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_number(self): + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + odu_type = __builtin__.property(_get_odu_type, _set_odu_type) + number = __builtin__.property(_get_number, _set_number) + ts_number = __builtin__.property(_get_ts_number, _set_ts_number) + + + _pyangbind_elements = OrderedDict([('odu_type', odu_type), ('number', number), ('ts_number', ts_number), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/te_nsrlgs/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/te_nsrlgs/__init__.py new file mode 100644 index 000000000..a3ab4519d --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/te_nsrlgs/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class te_nsrlgs(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/te-nsrlgs. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains a list of NSRLGs (Non-Shared Risk Link Groups). +When an abstract TE link is configured, this list specifies +the request that underlay TE paths need to be mutually +disjoint with other TE links in the same groups. + """ + __slots__ = ('_path_helper', '_extmethods', '__id',) + + _yang_name = 'te-nsrlgs' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__id = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'te-nsrlgs'] + + def _get_id(self): + """ + Getter method for id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/te_nsrlgs/id (uint32) + + YANG Description: NSRLG ID, uniquely configured within a topology. + """ + return self.__id + + def _set_id(self, v, load=False): + """ + Setter method for id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/te_nsrlgs/id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_id() directly. + + YANG Description: NSRLG ID, uniquely configured within a topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """id must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__id = t + if hasattr(self, '_set'): + self._set() + + def _unset_id(self): + self.__id = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + id = __builtin__.property(_get_id, _set_id) + + + _pyangbind_elements = OrderedDict([('id', id), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/te_srlgs/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/te_srlgs/__init__.py new file mode 100644 index 000000000..65f81a17e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/te_srlgs/__init__.py @@ -0,0 +1,115 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class te_srlgs(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/te-srlgs. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains a list of SRLGs. + """ + __slots__ = ('_path_helper', '_extmethods', '__value',) + + _yang_name = 'te-srlgs' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__value = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:srlg', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'te-srlgs'] + + def _get_value(self): + """ + Getter method for value, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/te_srlgs/value (te-types:srlg) + + YANG Description: SRLG value. + """ + return self.__value + + def _set_value(self, v, load=False): + """ + Setter method for value, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/te_srlgs/value (te-types:srlg) + If this variable is read-only (config: false) in the + source YANG file, then _set_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_value() directly. + + YANG Description: SRLG value. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:srlg', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """value must be of a type compatible with te-types:srlg""", + 'defined-type': "te-types:srlg", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:srlg', is_config=True)""", + }) + + self.__value = t + if hasattr(self, '_set'): + self._set() + + def _unset_value(self): + self.__value = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)), is_leaf=False, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:srlg', is_config=True) + + value = __builtin__.property(_get_value, _set_value) + + + _pyangbind_elements = OrderedDict([('value', value), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/__init__.py new file mode 100644 index 000000000..a1b69d2e2 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/__init__.py @@ -0,0 +1,326 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import primary_path +from . import backup_path +from . import tunnel_termination_points +from . import tunnels +class underlay(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/underlay. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Attributes of the TE link underlay. + """ + __slots__ = ('_path_helper', '_extmethods', '__enabled','__primary_path','__backup_path','__protection_type','__tunnel_termination_points','__tunnels',) + + _yang_name = 'underlay' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__enabled = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + self.__primary_path = YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__backup_path = YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + self.__protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + self.__tunnel_termination_points = YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__tunnels = YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'underlay'] + + def _get_enabled(self): + """ + Getter method for enabled, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/enabled (boolean) + + YANG Description: 'true' if the underlay is enabled. +'false' if the underlay is disabled. + """ + return self.__enabled + + def _set_enabled(self, v, load=False): + """ + Setter method for enabled, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/enabled (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_enabled is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_enabled() directly. + + YANG Description: 'true' if the underlay is enabled. +'false' if the underlay is disabled. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """enabled must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__enabled = t + if hasattr(self, '_set'): + self._set() + + def _unset_enabled(self): + self.__enabled = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + + def _get_primary_path(self): + """ + Getter method for primary_path, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path (container) + + YANG Description: The service path on the underlay topology that +supports this link. + """ + return self.__primary_path + + def _set_primary_path(self, v, load=False): + """ + Setter method for primary_path, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_primary_path is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_primary_path() directly. + + YANG Description: The service path on the underlay topology that +supports this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """primary_path must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__primary_path = t + if hasattr(self, '_set'): + self._set() + + def _unset_primary_path(self): + self.__primary_path = YANGDynClass(base=primary_path.primary_path, is_container='container', yang_name="primary-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_backup_path(self): + """ + Getter method for backup_path, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path (list) + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + return self.__backup_path + + def _set_backup_path(self, v, load=False): + """ + Setter method for backup_path, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_backup_path is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_backup_path() directly. + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """backup_path must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__backup_path = t + if hasattr(self, '_set'): + self._set() + + def _unset_backup_path(self): + self.__backup_path = YANGDynClass(base=YANGListType("index",backup_path.backup_path, yang_name="backup-path", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="backup-path", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + + def _get_protection_type(self): + """ + Getter method for protection_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/protection_type (identityref) + + YANG Description: Underlay protection type desired for this link. + """ + return self.__protection_type + + def _set_protection_type(self, v, load=False): + """ + Setter method for protection_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/protection_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_protection_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_protection_type() directly. + + YANG Description: Underlay protection type desired for this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """protection_type must be of a type compatible with identityref""", + 'defined-type': "ietf-te-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True)""", + }) + + self.__protection_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_protection_type(self): + self.__protection_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unprotected': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute-extra': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-reroute': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-n': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-1-for-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-unidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-bidir-1-plus-1': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'ietf-te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}, 'te-types:lsp-protection-extra-traffic': {'@module': 'ietf-te-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-te-types'}},), is_leaf=True, yang_name="protection-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='identityref', is_config=True) + + + def _get_tunnel_termination_points(self): + """ + Getter method for tunnel_termination_points, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/tunnel_termination_points (container) + + YANG Description: Underlay TTPs desired for this link. + """ + return self.__tunnel_termination_points + + def _set_tunnel_termination_points(self, v, load=False): + """ + Setter method for tunnel_termination_points, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/tunnel_termination_points (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel_termination_points is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel_termination_points() directly. + + YANG Description: Underlay TTPs desired for this link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel_termination_points must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__tunnel_termination_points = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel_termination_points(self): + self.__tunnel_termination_points = YANGDynClass(base=tunnel_termination_points.tunnel_termination_points, is_container='container', yang_name="tunnel-termination-points", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_tunnels(self): + """ + Getter method for tunnels, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/tunnels (container) + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + return self.__tunnels + + def _set_tunnels(self, v, load=False): + """ + Setter method for tunnels, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/tunnels (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnels is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnels() directly. + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnels must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__tunnels = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnels(self): + self.__tunnels = YANGDynClass(base=tunnels.tunnels, is_container='container', yang_name="tunnels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + enabled = __builtin__.property(_get_enabled, _set_enabled) + primary_path = __builtin__.property(_get_primary_path, _set_primary_path) + backup_path = __builtin__.property(_get_backup_path, _set_backup_path) + protection_type = __builtin__.property(_get_protection_type, _set_protection_type) + tunnel_termination_points = __builtin__.property(_get_tunnel_termination_points, _set_tunnel_termination_points) + tunnels = __builtin__.property(_get_tunnels, _set_tunnels) + + + _pyangbind_elements = OrderedDict([('enabled', enabled), ('primary_path', primary_path), ('backup_path', backup_path), ('protection_type', protection_type), ('tunnel_termination_points', tunnel_termination_points), ('tunnels', tunnels), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/__init__.py new file mode 100644 index 000000000..fe3e9714f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/__init__.py @@ -0,0 +1,207 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_element +class backup_path(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/underlay/backup-path. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of backup service paths on the underlay topology that +protect the underlay primary path. If the primary path is +not protected, the list contains zero elements. If the +primary path is protected, the list contains one or more +elements. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__network_ref','__path_element',) + + _yang_name = 'backup-path' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'underlay', 'backup-path'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/index (uint32) + + YANG Description: A sequence number to identify a backup path. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/index (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: A sequence number to identify a backup path. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + + def _get_path_element(self): + """ + Getter method for path_element, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element (list) + + YANG Description: A list of path elements describing the backup service +path. + """ + return self.__path_element + + def _set_path_element(self, v, load=False): + """ + Setter method for path_element, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element() directly. + + YANG Description: A list of path elements describing the backup service +path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_element = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element(self): + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + index = __builtin__.property(_get_index, _set_index) + network_ref = __builtin__.property(_get_network_ref, _set_network_ref) + path_element = __builtin__.property(_get_path_element, _set_path_element) + + + _pyangbind_elements = OrderedDict([('index', index), ('network_ref', network_ref), ('path_element', path_element), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/__init__.py new file mode 100644 index 000000000..62e01431a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/__init__.py @@ -0,0 +1,321 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class path_element(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/underlay/backup-path/path-element. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of path elements describing the backup service +path. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_element_id','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'path-element' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'underlay', 'backup-path', 'path-element'] + + def _get_path_element_id(self): + """ + Getter method for path_element_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/path_element_id (uint32) + + YANG Description: To identify the element in a path. + """ + return self.__path_element_id + + def _set_path_element_id(self, v, load=False): + """ + Setter method for path_element_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/path_element_id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element_id() directly. + + YANG Description: To identify the element in a path. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element_id must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__path_element_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element_id(self): + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + path_element_id = __builtin__.property(_get_path_element_id, _set_path_element_id) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop, _set_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop, _set_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop, _set_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop, _set_as_number_hop) + label_hop = __builtin__.property(_get_label_hop, _set_label_hop) + + __choices__ = {'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('path_element_id', path_element_id), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/as_number_hop/__init__.py new file mode 100644 index 000000000..25cce7314 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/underlay/backup-path/path-element/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'underlay', 'backup-path', 'path-element', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + as_number = __builtin__.property(_get_as_number, _set_as_number) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/__init__.py new file mode 100644 index 000000000..602bbac44 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/underlay/backup-path/path-element/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'underlay', 'backup-path', 'path-element', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/__init__.py new file mode 100644 index 000000000..1cfac3e4f --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/underlay/backup-path/path-element/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'underlay', 'backup-path', 'path-element', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py new file mode 100644 index 000000000..7510f12e3 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/underlay/backup-path/path-element/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'underlay', 'backup-path', 'path-element', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + tsg = __builtin__.property(_get_tsg, _set_tsg) + ts_list = __builtin__.property(_get_ts_list, _set_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop/__init__.py new file mode 100644 index 000000000..ebe98f0b0 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/underlay/backup-path/path-element/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'underlay', 'backup-path', 'path-element', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/numbered_node_hop/__init__.py new file mode 100644 index 000000000..204c0ffd8 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/underlay/backup-path/path-element/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'underlay', 'backup-path', 'path-element', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/numbered_node_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py new file mode 100644 index 000000000..49f6d8166 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/underlay/backup-path/path-element/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'underlay', 'backup-path', 'path-element', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/backup_path/path_element/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/__init__.py new file mode 100644 index 000000000..111fdc4e3 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/__init__.py @@ -0,0 +1,158 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import path_element +class primary_path(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/underlay/primary-path. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The service path on the underlay topology that +supports this link. + """ + __slots__ = ('_path_helper', '_extmethods', '__network_ref','__path_element',) + + _yang_name = 'primary-path' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'underlay', 'primary-path'] + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + + def _get_path_element(self): + """ + Getter method for path_element, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element (list) + + YANG Description: A list of path elements describing the service path. + """ + return self.__path_element + + def _set_path_element(self, v, load=False): + """ + Setter method for path_element, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element() directly. + + YANG Description: A list of path elements describing the service path. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__path_element = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element(self): + self.__path_element = YANGDynClass(base=YANGListType("path_element_id",path_element.path_element, yang_name="path-element", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='path-element-id', extensions=None), is_container='list', yang_name="path-element", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + network_ref = __builtin__.property(_get_network_ref, _set_network_ref) + path_element = __builtin__.property(_get_path_element, _set_path_element) + + + _pyangbind_elements = OrderedDict([('network_ref', network_ref), ('path_element', path_element), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/__init__.py new file mode 100644 index 000000000..71c1bd0cc --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/__init__.py @@ -0,0 +1,320 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import numbered_node_hop +from . import numbered_link_hop +from . import unnumbered_link_hop +from . import as_number_hop +from . import label_hop +class path_element(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/underlay/primary-path/path-element. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A list of path elements describing the service path. + """ + __slots__ = ('_path_helper', '_extmethods', '__path_element_id','__numbered_node_hop','__numbered_link_hop','__unnumbered_link_hop','__as_number_hop','__label_hop',) + + _yang_name = 'path-element' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'underlay', 'primary-path', 'path-element'] + + def _get_path_element_id(self): + """ + Getter method for path_element_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/path_element_id (uint32) + + YANG Description: To identify the element in a path. + """ + return self.__path_element_id + + def _set_path_element_id(self, v, load=False): + """ + Setter method for path_element_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/path_element_id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_path_element_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_path_element_id() directly. + + YANG Description: To identify the element in a path. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """path_element_id must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__path_element_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_path_element_id(self): + self.__path_element_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="path-element-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_numbered_node_hop(self): + """ + Getter method for numbered_node_hop, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/numbered_node_hop (container) + + YANG Description: Numbered node route hop. + """ + return self.__numbered_node_hop + + def _set_numbered_node_hop(self, v, load=False): + """ + Setter method for numbered_node_hop, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/numbered_node_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_node_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_node_hop() directly. + + YANG Description: Numbered node route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_node_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_node_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_node_hop(self): + self.__numbered_node_hop = YANGDynClass(base=numbered_node_hop.numbered_node_hop, is_container='container', yang_name="numbered-node-hop", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_numbered_link_hop(self): + """ + Getter method for numbered_link_hop, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop (container) + + YANG Description: Numbered link explicit route hop. + """ + return self.__numbered_link_hop + + def _set_numbered_link_hop(self, v, load=False): + """ + Setter method for numbered_link_hop, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_numbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_numbered_link_hop() directly. + + YANG Description: Numbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """numbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__numbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_numbered_link_hop(self): + self.__numbered_link_hop = YANGDynClass(base=numbered_link_hop.numbered_link_hop, is_container='container', yang_name="numbered-link-hop", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_unnumbered_link_hop(self): + """ + Getter method for unnumbered_link_hop, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop (container) + + YANG Description: Unnumbered link explicit route hop. + """ + return self.__unnumbered_link_hop + + def _set_unnumbered_link_hop(self, v, load=False): + """ + Setter method for unnumbered_link_hop, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_unnumbered_link_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unnumbered_link_hop() directly. + + YANG Description: Unnumbered link explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unnumbered_link_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__unnumbered_link_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_unnumbered_link_hop(self): + self.__unnumbered_link_hop = YANGDynClass(base=unnumbered_link_hop.unnumbered_link_hop, is_container='container', yang_name="unnumbered-link-hop", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_as_number_hop(self): + """ + Getter method for as_number_hop, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/as_number_hop (container) + + YANG Description: AS explicit route hop. + """ + return self.__as_number_hop + + def _set_as_number_hop(self, v, load=False): + """ + Setter method for as_number_hop, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/as_number_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number_hop() directly. + + YANG Description: AS explicit route hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__as_number_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number_hop(self): + self.__as_number_hop = YANGDynClass(base=as_number_hop.as_number_hop, is_container='container', yang_name="as-number-hop", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + + def _get_label_hop(self): + """ + Getter method for label_hop, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop (container) + + YANG Description: Label hop type. + """ + return self.__label_hop + + def _set_label_hop(self, v, load=False): + """ + Setter method for label_hop, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_label_hop is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_label_hop() directly. + + YANG Description: Label hop type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """label_hop must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__label_hop = t + if hasattr(self, '_set'): + self._set() + + def _unset_label_hop(self): + self.__label_hop = YANGDynClass(base=label_hop.label_hop, is_container='container', yang_name="label-hop", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + path_element_id = __builtin__.property(_get_path_element_id, _set_path_element_id) + numbered_node_hop = __builtin__.property(_get_numbered_node_hop, _set_numbered_node_hop) + numbered_link_hop = __builtin__.property(_get_numbered_link_hop, _set_numbered_link_hop) + unnumbered_link_hop = __builtin__.property(_get_unnumbered_link_hop, _set_unnumbered_link_hop) + as_number_hop = __builtin__.property(_get_as_number_hop, _set_as_number_hop) + label_hop = __builtin__.property(_get_label_hop, _set_label_hop) + + __choices__ = {'type': {'numbered-node-hop': ['numbered_node_hop'], 'numbered-link-hop': ['numbered_link_hop'], 'unnumbered-link-hop': ['unnumbered_link_hop'], 'as-number': ['as_number_hop'], 'label': ['label_hop']}} + _pyangbind_elements = OrderedDict([('path_element_id', path_element_id), ('numbered_node_hop', numbered_node_hop), ('numbered_link_hop', numbered_link_hop), ('unnumbered_link_hop', unnumbered_link_hop), ('as_number_hop', as_number_hop), ('label_hop', label_hop), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/as_number_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/as_number_hop/__init__.py new file mode 100644 index 000000000..37b1d287a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/as_number_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class as_number_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/underlay/primary-path/path-element/as-number-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: AS explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__as_number','__hop_type',) + + _yang_name = 'as-number-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'underlay', 'primary-path', 'path-element', 'as-number-hop'] + + def _get_as_number(self): + """ + Getter method for as_number, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/as_number_hop/as_number (inet:as-number) + + YANG Description: The Autonomous System (AS) number. + """ + return self.__as_number + + def _set_as_number(self, v, load=False): + """ + Setter method for as_number, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/as_number_hop/as_number (inet:as-number) + If this variable is read-only (config: false) in the + source YANG file, then _set_as_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_as_number() directly. + + YANG Description: The Autonomous System (AS) number. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """as_number must be of a type compatible with inet:as-number""", + 'defined-type': "inet:as-number", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True)""", + }) + + self.__as_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_as_number(self): + self.__as_number = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="as-number", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:as-number', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/as_number_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/as_number_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'as-number'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + as_number = __builtin__.property(_get_as_number, _set_as_number) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'as-number': ['as_number', 'hop_type']}} + _pyangbind_elements = OrderedDict([('as_number', as_number), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/__init__.py new file mode 100644 index 000000000..d2a98a8c6 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_label +class label_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/underlay/primary-path/path-element/label-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop type. + """ + __slots__ = ('_path_helper', '_extmethods', '__te_label',) + + _yang_name = 'label-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'underlay', 'primary-path', 'path-element', 'label-hop'] + + def _get_te_label(self): + """ + Getter method for te_label, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label (container) + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + return self.__te_label + + def _set_te_label(self, v, load=False): + """ + Setter method for te_label, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_label is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_label() directly. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_label must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_label = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_label(self): + self.__te_label = YANGDynClass(base=te_label.te_label, is_container='container', yang_name="te-label", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + te_label = __builtin__.property(_get_te_label, _set_te_label) + + __choices__ = {'type': {'label': ['te_label']}} + _pyangbind_elements = OrderedDict([('te_label', te_label), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/__init__.py new file mode 100644 index 000000000..b61128cae --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/__init__.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_label(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/underlay/primary-path/path-element/label-hop/te-label. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies the TE label. The choices can +be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__vlanid','__direction',) + + _yang_name = 'te-label' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'underlay', 'primary-path', 'path-element', 'label-hop', 'te-label'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + + YANG Description: TE label specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/generic (rt-types:generalized-label) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: TE label specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with rt-types:generalized-label""", + 'defined-type': "rt-types:generalized-label", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='rt-types:generalized-label', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn (container) + + YANG Description: Label hop for OTN. + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Label hop for OTN. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_vlanid(self): + """ + Getter method for vlanid, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + + YANG Description: VLAN tag id. + """ + return self.__vlanid + + def _set_vlanid(self, v, load=False): + """ + Setter method for vlanid, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/vlanid (etht-types:vlanid) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlanid is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlanid() directly. + + YANG Description: VLAN tag id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlanid must be of a type compatible with etht-types:vlanid""", + 'defined-type': "etht-types:vlanid", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True)""", + }) + + self.__vlanid = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlanid(self): + self.__vlanid = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlanid", parent=self, choice=('technology', 'eth'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='etht-types:vlanid', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/direction (te-label-direction) + + YANG Description: Label direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/direction (te-label-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Label direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-label-direction""", + 'defined-type': "ietf-te-topology:te-label-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'forward': {}, 'reverse': {}},), default=six.text_type("forward"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'label'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-label-direction', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + vlanid = __builtin__.property(_get_vlanid, _set_vlanid) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'technology': {'generic': ['generic'], 'otn': ['otn'], 'eth': ['vlanid']}, 'type': {'label': ['direction']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('vlanid', vlanid), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py new file mode 100644 index 000000000..c629a4834 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn/__init__.py @@ -0,0 +1,209 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/underlay/primary-path/path-element/label-hop/te-label/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Label hop for OTN. + """ + __slots__ = ('_path_helper', '_extmethods', '__tpn','__tsg','__ts_list',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'underlay', 'primary-path', 'path-element', 'label-hop', 'te-label', 'otn'] + + def _get_tpn(self): + """ + Getter method for tpn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + + YANG Description: Tributary Port Number (TPN). + """ + return self.__tpn + + def _set_tpn(self, v, load=False): + """ + Setter method for tpn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn/tpn (otn-tpn) + If this variable is read-only (config: false) in the + source YANG file, then _set_tpn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tpn() directly. + + YANG Description: Tributary Port Number (TPN). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tpn must be of a type compatible with otn-tpn""", + 'defined-type': "ietf-otn-topology:otn-tpn", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True)""", + }) + + self.__tpn = t + if hasattr(self, '_set'): + self._set() + + def _unset_tpn(self): + self.__tpn = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="tpn", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='otn-tpn', is_config=True) + + + def _get_tsg(self): + """ + Getter method for tsg, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn/tsg (identityref) + + YANG Description: Tributary Slot Granularity (TSG). + """ + return self.__tsg + + def _set_tsg(self, v, load=False): + """ + Setter method for tsg, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn/tsg (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_tsg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tsg() directly. + + YANG Description: Tributary Slot Granularity (TSG). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tsg must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__tsg = t + if hasattr(self, '_set'): + self._set() + + def _unset_tsg(self): + self.__tsg = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-1.25G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-2.5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:tsg-5G': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="tsg", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_ts_list(self): + """ + Getter method for ts_list, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn/ts_list (string) + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + return self.__ts_list + + def _set_ts_list(self, v, load=False): + """ + Setter method for ts_list, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/label_hop/te_label/otn/ts_list (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_list is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_list() directly. + + YANG Description: A list of available Tributary Slots (TS) ranging + + + + +between 1 and 4095. If multiple values or +ranges are given, they all MUST be disjoint +and MUST be in ascending order. +For example 1-20,25,50-1000. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_list must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True)""", + }) + + self.__ts_list = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_list(self): + self.__ts_list = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)'}), is_leaf=True, yang_name="ts-list", parent=self, choice=('technology', 'otn'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='string', is_config=True) + + tpn = __builtin__.property(_get_tpn, _set_tpn) + tsg = __builtin__.property(_get_tsg, _set_tsg) + ts_list = __builtin__.property(_get_ts_list, _set_ts_list) + + __choices__ = {'technology': {'otn': ['tpn', 'tsg', 'ts_list']}} + _pyangbind_elements = OrderedDict([('tpn', tpn), ('tsg', tsg), ('ts_list', ts_list), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop/__init__.py new file mode 100644 index 000000000..b3b44095b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop/__init__.py @@ -0,0 +1,193 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/underlay/primary-path/path-element/numbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__hop_type','__direction',) + + _yang_name = 'numbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'underlay', 'primary-path', 'path-element', 'numbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE Link Termination Point (LTP) identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/numbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'numbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'numbered-link-hop': ['link_tp_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/numbered_node_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/numbered_node_hop/__init__.py new file mode 100644 index 000000000..4e0f06397 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/numbered_node_hop/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class numbered_node_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/underlay/primary-path/path-element/numbered-node-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Numbered node route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__hop_type',) + + _yang_name = 'numbered-node-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'underlay', 'primary-path', 'path-element', 'numbered-node-hop'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/numbered_node_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/numbered_node_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/numbered_node_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/numbered_node_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'numbered-node-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + + __choices__ = {'type': {'numbered-node-hop': ['node_id', 'hop_type']}} + _pyangbind_elements = OrderedDict([('node_id', node_id), ('hop_type', hop_type), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py new file mode 100644 index 000000000..6f04ec7fc --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/__init__.py @@ -0,0 +1,236 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class unnumbered_link_hop(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/underlay/primary-path/path-element/unnumbered-link-hop. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unnumbered link explicit route hop. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_tp_id','__node_id','__hop_type','__direction',) + + _yang_name = 'unnumbered-link-hop' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'underlay', 'primary-path', 'path-element', 'unnumbered-link-hop'] + + def _get_link_tp_id(self): + """ + Getter method for link_tp_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + return self.__link_tp_id + + def _set_link_tp_id(self, v, load=False): + """ + Setter method for link_tp_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/link_tp_id (te-tp-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_tp_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_tp_id() directly. + + YANG Description: TE LTP identifier. The combination of the TE link ID +and the TE node ID is used to identify an unnumbered +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_tp_id must be of a type compatible with te-tp-id""", + 'defined-type': "ietf-te-topology:te-tp-id", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True)""", + }) + + self.__link_tp_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_tp_id(self): + self.__link_tp_id = YANGDynClass(base=[RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),], is_leaf=True, yang_name="link-tp-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-tp-id', is_config=True) + + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/node_id (te-node-id) + + YANG Description: The identifier of a node in the TE topology. + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/node_id (te-node-id) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + + YANG Description: The identifier of a node in the TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with te-node-id""", + 'defined-type': "ietf-te-topology:te-node-id", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'}), is_leaf=True, yang_name="node-id", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-node-id', is_config=True) + + + def _get_hop_type(self): + """ + Getter method for hop_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + + YANG Description: Strict or loose hop. + """ + return self.__hop_type + + def _set_hop_type(self, v, load=False): + """ + Setter method for hop_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/hop_type (te-hop-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_hop_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hop_type() directly. + + YANG Description: Strict or loose hop. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hop_type must be of a type compatible with te-hop-type""", + 'defined-type': "ietf-te-topology:te-hop-type", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True)""", + }) + + self.__hop_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_hop_type(self): + self.__hop_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'loose': {}, 'strict': {}},), default=six.text_type("strict"), is_leaf=True, yang_name="hop-type", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-hop-type', is_config=True) + + + def _get_direction(self): + """ + Getter method for direction, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/direction (te-link-direction) + + YANG Description: Link route object direction. + """ + return self.__direction + + def _set_direction(self, v, load=False): + """ + Setter method for direction, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/primary_path/path_element/unnumbered_link_hop/direction (te-link-direction) + If this variable is read-only (config: false) in the + source YANG file, then _set_direction is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_direction() directly. + + YANG Description: Link route object direction. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """direction must be of a type compatible with te-link-direction""", + 'defined-type': "ietf-te-topology:te-link-direction", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True)""", + }) + + self.__direction = t + if hasattr(self, '_set'): + self._set() + + def _unset_direction(self): + self.__direction = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'incoming': {}, 'outgoing': {}},), default=six.text_type("outgoing"), is_leaf=True, yang_name="direction", parent=self, choice=('type', 'unnumbered-link-hop'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-link-direction', is_config=True) + + link_tp_id = __builtin__.property(_get_link_tp_id, _set_link_tp_id) + node_id = __builtin__.property(_get_node_id, _set_node_id) + hop_type = __builtin__.property(_get_hop_type, _set_hop_type) + direction = __builtin__.property(_get_direction, _set_direction) + + __choices__ = {'type': {'unnumbered-link-hop': ['link_tp_id', 'node_id', 'hop_type', 'direction']}} + _pyangbind_elements = OrderedDict([('link_tp_id', link_tp_id), ('node_id', node_id), ('hop_type', hop_type), ('direction', direction), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/tunnel_termination_points/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/tunnel_termination_points/__init__.py new file mode 100644 index 000000000..801aa8c42 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/tunnel_termination_points/__init__.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class tunnel_termination_points(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/underlay/tunnel-termination-points. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Underlay TTPs desired for this link. + """ + __slots__ = ('_path_helper', '_extmethods', '__source','__destination',) + + _yang_name = 'tunnel-termination-points' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__source = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + self.__destination = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'underlay', 'tunnel-termination-points'] + + def _get_source(self): + """ + Getter method for source, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/tunnel_termination_points/source (binary) + + YANG Description: Source TTP identifier. + """ + return self.__source + + def _set_source(self, v, load=False): + """ + Setter method for source, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/tunnel_termination_points/source (binary) + If this variable is read-only (config: false) in the + source YANG file, then _set_source is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_source() directly. + + YANG Description: Source TTP identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """source must be of a type compatible with binary""", + 'defined-type': "binary", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True)""", + }) + + self.__source = t + if hasattr(self, '_set'): + self._set() + + def _unset_source(self): + self.__source = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="source", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + + + def _get_destination(self): + """ + Getter method for destination, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/tunnel_termination_points/destination (binary) + + YANG Description: Destination TTP identifier. + """ + return self.__destination + + def _set_destination(self, v, load=False): + """ + Setter method for destination, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/tunnel_termination_points/destination (binary) + If this variable is read-only (config: false) in the + source YANG file, then _set_destination is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_destination() directly. + + YANG Description: Destination TTP identifier. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """destination must be of a type compatible with binary""", + 'defined-type': "binary", + 'generated-type': """YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True)""", + }) + + self.__destination = t + if hasattr(self, '_set'): + self._set() + + def _unset_destination(self): + self.__destination = YANGDynClass(base=YANGBinary, is_leaf=True, yang_name="destination", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='binary', is_config=True) + + source = __builtin__.property(_get_source, _set_source) + destination = __builtin__.property(_get_destination, _set_destination) + + + _pyangbind_elements = OrderedDict([('source', source), ('destination', destination), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/tunnels/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/tunnels/__init__.py new file mode 100644 index 000000000..e2a5a218a --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/tunnels/__init__.py @@ -0,0 +1,167 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import tunnel +class tunnels(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/underlay/tunnels. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Underlay TE tunnels supporting this TE link. + """ + __slots__ = ('_path_helper', '_extmethods', '__sharing','__tunnel',) + + _yang_name = 'tunnels' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__sharing = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + self.__tunnel = YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'underlay', 'tunnels'] + + def _get_sharing(self): + """ + Getter method for sharing, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/tunnels/sharing (boolean) + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. +This leaf is the default option for all TE tunnels +and may be overridden by the per-TE-tunnel value. + """ + return self.__sharing + + def _set_sharing(self, v, load=False): + """ + Setter method for sharing, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/tunnels/sharing (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_sharing is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_sharing() directly. + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. +This leaf is the default option for all TE tunnels +and may be overridden by the per-TE-tunnel value. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """sharing must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__sharing = t + if hasattr(self, '_set'): + self._set() + + def _unset_sharing(self): + self.__sharing = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + + def _get_tunnel(self): + """ + Getter method for tunnel, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/tunnels/tunnel (list) + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + return self.__tunnel + + def _set_tunnel(self, v, load=False): + """ + Setter method for tunnel, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/tunnels/tunnel (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel() directly. + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True)""", + }) + + self.__tunnel = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel(self): + self.__tunnel = YANGDynClass(base=YANGListType("tunnel_name",tunnel.tunnel, yang_name="tunnel", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='tunnel-name', extensions=None), is_container='list', yang_name="tunnel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='list', is_config=True) + + sharing = __builtin__.property(_get_sharing, _set_sharing) + tunnel = __builtin__.property(_get_tunnel, _set_tunnel) + + + _pyangbind_elements = OrderedDict([('sharing', sharing), ('tunnel', tunnel), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/tunnels/tunnel/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/tunnels/tunnel/__init__.py new file mode 100644 index 000000000..24bfd8831 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/underlay/tunnels/tunnel/__init__.py @@ -0,0 +1,170 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class tunnel(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/underlay/tunnels/tunnel. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Zero, one, or more underlay TE tunnels that support this +TE link. + """ + __slots__ = ('_path_helper', '_extmethods', '__tunnel_name','__sharing',) + + _yang_name = 'tunnel' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__tunnel_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + self.__sharing = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'underlay', 'tunnels', 'tunnel'] + + def _get_tunnel_name(self): + """ + Getter method for tunnel_name, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/tunnels/tunnel/tunnel_name (string) + + YANG Description: A tunnel name uniquely identifies an underlay TE tunnel, +used together with the 'source-node' value for this +link. + """ + return self.__tunnel_name + + def _set_tunnel_name(self, v, load=False): + """ + Setter method for tunnel_name, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/tunnels/tunnel/tunnel_name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_tunnel_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tunnel_name() directly. + + YANG Description: A tunnel name uniquely identifies an underlay TE tunnel, +used together with the 'source-node' value for this +link. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tunnel_name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True)""", + }) + + self.__tunnel_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_tunnel_name(self): + self.__tunnel_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="tunnel-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + + def _get_sharing(self): + """ + Getter method for sharing, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/tunnels/tunnel/sharing (boolean) + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. + """ + return self.__sharing + + def _set_sharing(self, v, load=False): + """ + Setter method for sharing, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/underlay/tunnels/tunnel/sharing (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_sharing is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_sharing() directly. + + YANG Description: 'true' if the underlay tunnel can be shared with other +TE links; +'false' if the underlay tunnel is dedicated to this +TE link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """sharing must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True)""", + }) + + self.__sharing = t + if hasattr(self, '_set'): + self._set() + + def _unset_sharing(self): + self.__sharing = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="sharing", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='boolean', is_config=True) + + tunnel_name = __builtin__.property(_get_tunnel_name, _set_tunnel_name) + sharing = __builtin__.property(_get_sharing, _set_sharing) + + + _pyangbind_elements = OrderedDict([('tunnel_name', tunnel_name), ('sharing', sharing), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/__init__.py new file mode 100644 index 000000000..47c06f99e --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/__init__.py @@ -0,0 +1,163 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_bandwidth +class unreserved_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/unreserved-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Unreserved bandwidth for priority levels 0-7. Units are in +bytes per second. + """ + __slots__ = ('_path_helper', '_extmethods', '__priority','__te_bandwidth',) + + _yang_name = 'unreserved-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'unreserved-bandwidth'] + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/priority (uint8) + + YANG Description: Priority. + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/priority (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: Priority. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..7']}), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint8', is_config=True) + + + def _get_te_bandwidth(self): + """ + Getter method for te_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth (container) + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + return self.__te_bandwidth + + def _set_te_bandwidth(self, v, load=False): + """ + Setter method for te_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_bandwidth() directly. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_bandwidth must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_bandwidth(self): + self.__te_bandwidth = YANGDynClass(base=te_bandwidth.te_bandwidth, is_container='container', yang_name="te-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + priority = __builtin__.property(_get_priority, _set_priority) + te_bandwidth = __builtin__.property(_get_te_bandwidth, _set_te_bandwidth) + + + _pyangbind_elements = OrderedDict([('priority', priority), ('te_bandwidth', te_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/__init__.py new file mode 100644 index 000000000..35527bd35 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/__init__.py @@ -0,0 +1,195 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import otn +class te_bandwidth(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/unreserved-bandwidth/te-bandwidth. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Container that specifies TE bandwidth. The choices +can be augmented for specific data-plane technologies. + """ + __slots__ = ('_path_helper', '_extmethods', '__generic','__otn','__eth_bandwidth',) + + _yang_name = 'te-bandwidth' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'unreserved-bandwidth', 'te-bandwidth'] + + def _get_generic(self): + """ + Getter method for generic, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/generic (te-bandwidth) + + YANG Description: Bandwidth specified in a generic format. + """ + return self.__generic + + def _set_generic(self, v, load=False): + """ + Setter method for generic, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/generic (te-bandwidth) + If this variable is read-only (config: false) in the + source YANG file, then _set_generic is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_generic() directly. + + YANG Description: Bandwidth specified in a generic format. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """generic must be of a type compatible with te-bandwidth""", + 'defined-type': "ietf-te-topology:te-bandwidth", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True)""", + }) + + self.__generic = t + if hasattr(self, '_set'): + self._set() + + def _unset_generic(self): + self.__generic = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+(,(0[xX](0((\\.0?)?[pP](\\+)?0?|(\\.0?))|1(\\.([\\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\\+)?(12[0-7]|1[01]\\d|0?\\d?\\d)?)|0[xX][\\da-fA-F]{1,8}|\\d+))*'}), is_leaf=True, yang_name="generic", parent=self, choice=('technology', 'generic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-bandwidth', is_config=True) + + + def _get_otn(self): + """ + Getter method for otn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn (container) + + YANG Description: Bandwidth attributes for OTN links + """ + return self.__otn + + def _set_otn(self, v, load=False): + """ + Setter method for otn, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_otn is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_otn() directly. + + YANG Description: Bandwidth attributes for OTN links + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """otn must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True)""", + }) + + self.__otn = t + if hasattr(self, '_set'): + self._set() + + def _unset_otn(self): + self.__otn = YANGDynClass(base=otn.otn, is_container='container', yang_name="otn", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='container', is_config=True) + + + def _get_eth_bandwidth(self): + """ + Getter method for eth_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/eth_bandwidth (uint64) + + YANG Description: Available bandwith value expressed in kilobits per second + """ + return self.__eth_bandwidth + + def _set_eth_bandwidth(self, v, load=False): + """ + Setter method for eth_bandwidth, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/eth_bandwidth (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_eth_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_eth_bandwidth() directly. + + YANG Description: Available bandwith value expressed in kilobits per second + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """eth_bandwidth must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True)""", + }) + + self.__eth_bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_eth_bandwidth(self): + self.__eth_bandwidth = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), restriction_dict={'range': ['0..10000000000']}), is_leaf=True, yang_name="eth-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-eth-te-topology', defining_module='ietf-eth-te-topology', yang_type='uint64', is_config=True) + + generic = __builtin__.property(_get_generic, _set_generic) + otn = __builtin__.property(_get_otn, _set_otn) + eth_bandwidth = __builtin__.property(_get_eth_bandwidth, _set_eth_bandwidth) + + __choices__ = {'technology': {'generic': ['generic']}} + _pyangbind_elements = OrderedDict([('generic', generic), ('otn', otn), ('eth_bandwidth', eth_bandwidth), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/__init__.py new file mode 100644 index 000000000..9f57b381b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import odulist +class otn(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/unreserved-bandwidth/te-bandwidth/otn. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Bandwidth attributes for OTN links + """ + __slots__ = ('_path_helper', '_extmethods', '__odulist',) + + _yang_name = 'otn' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'unreserved-bandwidth', 'te-bandwidth', 'otn'] + + def _get_odulist(self): + """ + Getter method for odulist, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist (list) + + YANG Description: OTN bandwidth definition + """ + return self.__odulist + + def _set_odulist(self, v, load=False): + """ + Setter method for odulist, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_odulist is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odulist() directly. + + YANG Description: OTN bandwidth definition + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odulist must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True)""", + }) + + self.__odulist = t + if hasattr(self, '_set'): + self._set() + + def _unset_odulist(self): + self.__odulist = YANGDynClass(base=YANGListType("odu_type",odulist.odulist, yang_name="odulist", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='odu-type', extensions=None), is_container='list', yang_name="odulist", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='list', is_config=True) + + odulist = __builtin__.property(_get_odulist, _set_odulist) + + + _pyangbind_elements = OrderedDict([('odulist', odulist), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist/__init__.py new file mode 100644 index 000000000..67eca2bd3 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist/__init__.py @@ -0,0 +1,200 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class odulist(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/link-template/te-link-attributes/unreserved-bandwidth/te-bandwidth/otn/odulist. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: OTN bandwidth definition + """ + __slots__ = ('_path_helper', '_extmethods', '__odu_type','__number','__ts_number',) + + _yang_name = 'odulist' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'link-template', 'te-link-attributes', 'unreserved-bandwidth', 'te-bandwidth', 'otn', 'odulist'] + + def _get_odu_type(self): + """ + Getter method for odu_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist/odu_type (identityref) + + YANG Description: ODU type + """ + return self.__odu_type + + def _set_odu_type(self, v, load=False): + """ + Setter method for odu_type, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist/odu_type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_odu_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_odu_type() directly. + + YANG Description: ODU type + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """odu_type must be of a type compatible with identityref""", + 'defined-type': "ietf-otn-topology:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True)""", + }) + + self.__odu_type = t + if hasattr(self, '_set'): + self._set() + + def _unset_odu_type(self): + self.__odu_type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU0': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU1': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU2e': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU3': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODU4': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'ietf-layer1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}, 'l1-types:ODUflex-resizable': {'@module': 'ietf-layer1-types', '@namespace': 'urn:ietf:params:xml:ns:yang:ietf-layer1-types'}},), is_leaf=True, yang_name="odu-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='identityref', is_config=True) + + + def _get_number(self): + """ + Getter method for number, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist/number (uint16) + + YANG Description: Number of ODUs + """ + return self.__number + + def _set_number(self, v, load=False): + """ + Setter method for number, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist/number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_number() directly. + + YANG Description: Number of ODUs + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__number = t + if hasattr(self, '_set'): + self._set() + + def _unset_number(self): + self.__number = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + + def _get_ts_number(self): + """ + Getter method for ts_number, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist/ts_number (uint16) + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + return self.__ts_number + + def _set_ts_number(self, v, load=False): + """ + Setter method for ts_number, mapped from YANG variable /networks/te/templates/link_template/te_link_attributes/unreserved_bandwidth/te_bandwidth/otn/odulist/ts_number (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_ts_number is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ts_number() directly. + + YANG Description: The number of Tributary Slots (TS) that +could be used by all the ODUflex LSPs. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ts_number must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True)""", + }) + + self.__ts_number = t + if hasattr(self, '_set'): + self._set() + + def _unset_ts_number(self): + self.__ts_number = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4095']}), is_leaf=True, yang_name="ts-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-otn-topology', defining_module='ietf-otn-topology', yang_type='uint16', is_config=True) + + odu_type = __builtin__.property(_get_odu_type, _set_odu_type) + number = __builtin__.property(_get_number, _set_number) + ts_number = __builtin__.property(_get_ts_number, _set_ts_number) + + + _pyangbind_elements = OrderedDict([('odu_type', odu_type), ('number', number), ('ts_number', ts_number), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/node_template/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/node_template/__init__.py new file mode 100644 index 000000000..f7a053a34 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/node_template/__init__.py @@ -0,0 +1,251 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import te_node_attributes +class node_template(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/node-template. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The list of TE node templates used to define sharable +and reusable TE node attributes. + """ + __slots__ = ('_path_helper', '_extmethods', '__name','__priority','__reference_change_policy','__te_node_attributes',) + + _yang_name = 'node-template' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '/?([a-zA-Z0-9\\-_.]+)(/[a-zA-Z0-9\\-_.]+)*'}), is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-template-name', is_config=True) + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=True) + self.__reference_change_policy = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'no-action': {}, 'not-allowed': {}, 'cascade': {}},), is_leaf=True, yang_name="reference-change-policy", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + self.__te_node_attributes = YANGDynClass(base=te_node_attributes.te_node_attributes, is_container='container', yang_name="te-node-attributes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'node-template'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /networks/te/templates/node_template/name (te-types:te-template-name) + + YANG Description: The name to identify a TE node template. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /networks/te/templates/node_template/name (te-types:te-template-name) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: The name to identify a TE node template. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '/?([a-zA-Z0-9\\-_.]+)(/[a-zA-Z0-9\\-_.]+)*'}), is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-template-name', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with te-types:te-template-name""", + 'defined-type': "te-types:te-template-name", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '/?([a-zA-Z0-9\\-_.]+)(/[a-zA-Z0-9\\-_.]+)*'}), is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-template-name', is_config=True)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '/?([a-zA-Z0-9\\-_.]+)(/[a-zA-Z0-9\\-_.]+)*'}), is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-template-name', is_config=True) + + + def _get_priority(self): + """ + Getter method for priority, mapped from YANG variable /networks/te/templates/node_template/priority (uint16) + + YANG Description: The preference value for resolving conflicts between +different templates. When two or more templates specify +values for one configuration attribute, the value from the +template with the highest priority is used. +A lower number indicates a higher priority. The highest +priority is 0. + """ + return self.__priority + + def _set_priority(self, v, load=False): + """ + Setter method for priority, mapped from YANG variable /networks/te/templates/node_template/priority (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_priority is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_priority() directly. + + YANG Description: The preference value for resolving conflicts between +different templates. When two or more templates specify +values for one configuration attribute, the value from the +template with the highest priority is used. +A lower number indicates a higher priority. The highest +priority is 0. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """priority must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=True)""", + }) + + self.__priority = t + if hasattr(self, '_set'): + self._set() + + def _unset_priority(self): + self.__priority = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint16', is_config=True) + + + def _get_reference_change_policy(self): + """ + Getter method for reference_change_policy, mapped from YANG variable /networks/te/templates/node_template/reference_change_policy (enumeration) + + YANG Description: This attribute specifies the action taken for a +configuration node that has a reference to this template. + """ + return self.__reference_change_policy + + def _set_reference_change_policy(self, v, load=False): + """ + Setter method for reference_change_policy, mapped from YANG variable /networks/te/templates/node_template/reference_change_policy (enumeration) + If this variable is read-only (config: false) in the + source YANG file, then _set_reference_change_policy is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_reference_change_policy() directly. + + YANG Description: This attribute specifies the action taken for a +configuration node that has a reference to this template. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'no-action': {}, 'not-allowed': {}, 'cascade': {}},), is_leaf=True, yang_name="reference-change-policy", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """reference_change_policy must be of a type compatible with enumeration""", + 'defined-type': "ietf-te-topology:enumeration", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'no-action': {}, 'not-allowed': {}, 'cascade': {}},), is_leaf=True, yang_name="reference-change-policy", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True)""", + }) + + self.__reference_change_policy = t + if hasattr(self, '_set'): + self._set() + + def _unset_reference_change_policy(self): + self.__reference_change_policy = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'no-action': {}, 'not-allowed': {}, 'cascade': {}},), is_leaf=True, yang_name="reference-change-policy", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='enumeration', is_config=True) + + + def _get_te_node_attributes(self): + """ + Getter method for te_node_attributes, mapped from YANG variable /networks/te/templates/node_template/te_node_attributes (container) + + YANG Description: Contains node attributes in a TE topology. + """ + return self.__te_node_attributes + + def _set_te_node_attributes(self, v, load=False): + """ + Setter method for te_node_attributes, mapped from YANG variable /networks/te/templates/node_template/te_node_attributes (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_te_node_attributes is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_te_node_attributes() directly. + + YANG Description: Contains node attributes in a TE topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=te_node_attributes.te_node_attributes, is_container='container', yang_name="te-node-attributes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """te_node_attributes must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=te_node_attributes.te_node_attributes, is_container='container', yang_name="te-node-attributes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__te_node_attributes = t + if hasattr(self, '_set'): + self._set() + + def _unset_te_node_attributes(self): + self.__te_node_attributes = YANGDynClass(base=te_node_attributes.te_node_attributes, is_container='container', yang_name="te-node-attributes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + name = __builtin__.property(_get_name, _set_name) + priority = __builtin__.property(_get_priority, _set_priority) + reference_change_policy = __builtin__.property(_get_reference_change_policy, _set_reference_change_policy) + te_node_attributes = __builtin__.property(_get_te_node_attributes, _set_te_node_attributes) + + + _pyangbind_elements = OrderedDict([('name', name), ('priority', priority), ('reference_change_policy', reference_change_policy), ('te_node_attributes', te_node_attributes), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/node_template/te_node_attributes/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/node_template/te_node_attributes/__init__.py new file mode 100644 index 000000000..32a98a2da --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/node_template/te_node_attributes/__init__.py @@ -0,0 +1,317 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import underlay_topology +class te_node_attributes(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/node-template/te-node-attributes. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Contains node attributes in a TE topology. + """ + __slots__ = ('_path_helper', '_extmethods', '__admin_status','__domain_id','__is_abstract','__name','__signaling_address','__underlay_topology',) + + _yang_name = 'te-node-attributes' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__admin_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True) + self.__domain_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="domain-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + self.__is_abstract = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-abstract", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=True) + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + self.__signaling_address = YANGDynClass(unique=True, base=TypedListType(allowed_type=[RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),]), is_leaf=False, yang_name="signaling-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:ip-address', is_config=True) + self.__underlay_topology = YANGDynClass(base=underlay_topology.underlay_topology, is_container='container', yang_name="underlay-topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'node-template', 'te-node-attributes'] + + def _get_admin_status(self): + """ + Getter method for admin_status, mapped from YANG variable /networks/te/templates/node_template/te_node_attributes/admin_status (te-types:te-admin-status) + + YANG Description: The administrative state of the link. + """ + return self.__admin_status + + def _set_admin_status(self, v, load=False): + """ + Setter method for admin_status, mapped from YANG variable /networks/te/templates/node_template/te_node_attributes/admin_status (te-types:te-admin-status) + If this variable is read-only (config: false) in the + source YANG file, then _set_admin_status is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_admin_status() directly. + + YANG Description: The administrative state of the link. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """admin_status must be of a type compatible with te-types:te-admin-status""", + 'defined-type': "te-types:te-admin-status", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True)""", + }) + + self.__admin_status = t + if hasattr(self, '_set'): + self._set() + + def _unset_admin_status(self): + self.__admin_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'up': {}, 'down': {}, 'testing': {}, 'preparing-maintenance': {}, 'maintenance': {}, 'unknown': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='te-types:te-admin-status', is_config=True) + + + def _get_domain_id(self): + """ + Getter method for domain_id, mapped from YANG variable /networks/te/templates/node_template/te_node_attributes/domain_id (uint32) + + YANG Description: Identifies the domain to which this node belongs. +This attribute is used to support inter-domain links. + """ + return self.__domain_id + + def _set_domain_id(self, v, load=False): + """ + Setter method for domain_id, mapped from YANG variable /networks/te/templates/node_template/te_node_attributes/domain_id (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_domain_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_domain_id() directly. + + YANG Description: Identifies the domain to which this node belongs. +This attribute is used to support inter-domain links. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="domain-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """domain_id must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="domain-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True)""", + }) + + self.__domain_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_domain_id(self): + self.__domain_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="domain-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='uint32', is_config=True) + + + def _get_is_abstract(self): + """ + Getter method for is_abstract, mapped from YANG variable /networks/te/templates/node_template/te_node_attributes/is_abstract (empty) + + YANG Description: Present if the node is abstract; not present if the node +is actual. + """ + return self.__is_abstract + + def _set_is_abstract(self, v, load=False): + """ + Setter method for is_abstract, mapped from YANG variable /networks/te/templates/node_template/te_node_attributes/is_abstract (empty) + If this variable is read-only (config: false) in the + source YANG file, then _set_is_abstract is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_is_abstract() directly. + + YANG Description: Present if the node is abstract; not present if the node +is actual. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="is-abstract", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """is_abstract must be of a type compatible with empty""", + 'defined-type': "empty", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-abstract", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=True)""", + }) + + self.__is_abstract = t + if hasattr(self, '_set'): + self._set() + + def _unset_is_abstract(self): + self.__is_abstract = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="is-abstract", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='empty', is_config=True) + + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /networks/te/templates/node_template/te_node_attributes/name (string) + + YANG Description: Node name. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /networks/te/templates/node_template/te_node_attributes/name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: Node name. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='string', is_config=True) + + + def _get_signaling_address(self): + """ + Getter method for signaling_address, mapped from YANG variable /networks/te/templates/node_template/te_node_attributes/signaling_address (inet:ip-address) + + YANG Description: The node's signaling address. + """ + return self.__signaling_address + + def _set_signaling_address(self, v, load=False): + """ + Setter method for signaling_address, mapped from YANG variable /networks/te/templates/node_template/te_node_attributes/signaling_address (inet:ip-address) + If this variable is read-only (config: false) in the + source YANG file, then _set_signaling_address is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_signaling_address() directly. + + YANG Description: The node's signaling address. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=[RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),]), is_leaf=False, yang_name="signaling-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:ip-address', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """signaling_address must be of a type compatible with inet:ip-address""", + 'defined-type': "inet:ip-address", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=[RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),]), is_leaf=False, yang_name="signaling-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:ip-address', is_config=True)""", + }) + + self.__signaling_address = t + if hasattr(self, '_set'): + self._set() + + def _unset_signaling_address(self): + self.__signaling_address = YANGDynClass(unique=True, base=TypedListType(allowed_type=[RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),]), is_leaf=False, yang_name="signaling-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='inet:ip-address', is_config=True) + + + def _get_underlay_topology(self): + """ + Getter method for underlay_topology, mapped from YANG variable /networks/te/templates/node_template/te_node_attributes/underlay_topology (container) + + YANG Description: When an abstract node encapsulates a topology, the +attributes in this container point to said topology. + """ + return self.__underlay_topology + + def _set_underlay_topology(self, v, load=False): + """ + Setter method for underlay_topology, mapped from YANG variable /networks/te/templates/node_template/te_node_attributes/underlay_topology (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_underlay_topology is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_underlay_topology() directly. + + YANG Description: When an abstract node encapsulates a topology, the +attributes in this container point to said topology. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=underlay_topology.underlay_topology, is_container='container', yang_name="underlay-topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """underlay_topology must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=underlay_topology.underlay_topology, is_container='container', yang_name="underlay-topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True)""", + }) + + self.__underlay_topology = t + if hasattr(self, '_set'): + self._set() + + def _unset_underlay_topology(self): + self.__underlay_topology = YANGDynClass(base=underlay_topology.underlay_topology, is_container='container', yang_name="underlay-topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='container', is_config=True) + + admin_status = __builtin__.property(_get_admin_status, _set_admin_status) + domain_id = __builtin__.property(_get_domain_id, _set_domain_id) + is_abstract = __builtin__.property(_get_is_abstract, _set_is_abstract) + name = __builtin__.property(_get_name, _set_name) + signaling_address = __builtin__.property(_get_signaling_address, _set_signaling_address) + underlay_topology = __builtin__.property(_get_underlay_topology, _set_underlay_topology) + + + _pyangbind_elements = OrderedDict([('admin_status', admin_status), ('domain_id', domain_id), ('is_abstract', is_abstract), ('name', name), ('signaling_address', signaling_address), ('underlay_topology', underlay_topology), ]) + + diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/node_template/te_node_attributes/underlay_topology/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/node_template/te_node_attributes/underlay_topology/__init__.py new file mode 100644 index 000000000..9480263d4 --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/bindings/networks/te/templates/node_template/te_node_attributes/underlay_topology/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.yangtypes import YANGBinary +from pyangbind.lib.yangtypes import YANGBitsType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class underlay_topology(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module ietf-network - based on the path /networks/te/templates/node-template/te-node-attributes/underlay-topology. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: When an abstract node encapsulates a topology, the +attributes in this container point to said topology. + """ + __slots__ = ('_path_helper', '_extmethods', '__network_ref',) + + _yang_name = 'underlay-topology' + _yang_namespace = 'urn:ietf:params:xml:ns:yang:ietf-network' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['networks', 'te', 'templates', 'node-template', 'te-node-attributes', 'underlay-topology'] + + def _get_network_ref(self): + """ + Getter method for network_ref, mapped from YANG variable /networks/te/templates/node_template/te_node_attributes/underlay_topology/network_ref (leafref) + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + return self.__network_ref + + def _set_network_ref(self, v, load=False): + """ + Setter method for network_ref, mapped from YANG variable /networks/te/templates/node_template/te_node_attributes/underlay_topology/network_ref (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_network_ref is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_network_ref() directly. + + YANG Description: Used to reference a network -- for example, an underlay +network. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """network_ref must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True)""", + }) + + self.__network_ref = t + if hasattr(self, '_set'): + self._set() + + def _unset_network_ref(self): + self.__network_ref = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="network-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:ietf:params:xml:ns:yang:ietf-te-topology', defining_module='ietf-te-topology', yang_type='leafref', is_config=True) + + network_ref = __builtin__.property(_get_network_ref, _set_network_ref) + + + _pyangbind_elements = OrderedDict([('network_ref', network_ref), ]) + + diff --git a/src/nbi/tests/test_ietf_network.py b/src/nbi/tests/test_ietf_network.py index a8b812437..6fa09dd65 100644 --- a/src/nbi/tests/test_ietf_network.py +++ b/src/nbi/tests/test_ietf_network.py @@ -44,7 +44,7 @@ def test_prepare_environment(context_client : ContextClient) -> None: # pylint: # Verify the scenario has no services/slices response = context_client.GetContext(ADMIN_CONTEXT_ID) - assert len(response.topology_ids) == 3 + assert len(response.topology_ids) == 1 assert len(response.service_ids ) == 0 assert len(response.slice_ids ) == 0 @@ -81,9 +81,7 @@ def test_rest_get_networks(nbi_service_rest : RestServer): # pylint: disable=red URL = '/restconf/data/ietf-network:networks' retrieved_data = do_rest_request(URL, logger=LOGGER, expected_status_codes={200}) sort_data(retrieved_data) - LOGGER.warning('retrieved_data={:s}'.format(json.dumps(retrieved_data, sort_keys=True))) sort_data(target_data) - LOGGER.warning('target_data={:s}'.format(json.dumps(target_data, sort_keys=True))) diff_data = deepdiff.DeepDiff(target_data, retrieved_data) LOGGER.error('Differences:\n{:s}'.format(str(diff_data.pretty()))) assert len(diff_data) == 0 @@ -91,7 +89,7 @@ def test_rest_get_networks(nbi_service_rest : RestServer): # pylint: disable=red def test_cleanup_environment(context_client : ContextClient) -> None: # pylint: disable=redefined-outer-name # Verify the scenario has no services/slices response = context_client.GetContext(ADMIN_CONTEXT_ID) - assert len(response.topology_ids) == 3 + assert len(response.topology_ids) == 1 assert len(response.service_ids ) == 0 assert len(response.slice_ids ) == 0 -- GitLab From b4ea6c566c3d77f8453d2689683344bca26f8026 Mon Sep 17 00:00:00 2001 From: gifrerenom Date: Wed, 20 Dec 2023 14:40:29 +0000 Subject: [PATCH 14/16] WebUI component: - Remove incorrect topology icons --- .../static/topology_icons/emu-laptop.png | Bin 16735 -> 0 bytes .../service/static/topology_icons/laptop.png | Bin 18192 -> 0 bytes 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/webui/service/static/topology_icons/emu-laptop.png delete mode 100644 src/webui/service/static/topology_icons/laptop.png diff --git a/src/webui/service/static/topology_icons/emu-laptop.png b/src/webui/service/static/topology_icons/emu-laptop.png deleted file mode 100644 index 0c75b47e062c9dae0d3dee74c89ac22a97c93077..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16735 zcmd_S=R2HV)HbXPMxW7p8KV;=dWqg65e%b7k6xohFM|=iw`f5kW5^IK5u*2yNQe@N z5+XVwI?v^IzxVO}3D0{R?+0JTWzW9WUVE)`o$FkZjPB`BlChBC;o(v0>1rC|;o*zi z{D6spPo6}i1>)gx;pu6rnTFVI+mN&&`ll9HQ$$JKMI?ynS%Xv?v`x2&SRITYbkYn) z4XoJcj^L#DzF2KFTpz)V5e(hosQJ8L2EED{mLhrGIvy5Kpt$=zY~oqic$oE%xu1h1 z-xas9h3(^Gr8cGln$ciLjDni#rqeSvJ}4J~rm8N|8U%d$m68CCeOD+%l>>(0(=dF) z1AZA8heulL{o*MhFM(z>s$W_agjQYPQtiPMzgkvJ0-mtgs=JLUJfB~wsyO?g%#UlbkHuP=PXw1xh`PV#3Ijuuu zGc`;+W5Hhu2_7X4<-z>lp_MS02^3WkivB4wZ8cTGJZb2&yv*P!wBkR$ecn11`S2)A-P>wk<(0XGSK0|FqP2;3mGlY25HQ1 zKTXrA-7mnxxeTwKjWRpRFlN4LnLXeA@X$7VzyDd7eSoIjm8#v}kFxpf!QUm^#DibC z?>1G!?W?tfe)|s;tZ4p{ocCNjs$7JFRU`9#=>!(PRX#H}Y-!6PqD)^`@BItH{>;e?{-o-~M z=Y`?dm&cPY42x@eTYpAcDFkg5%$(xvd!5!l36#g>s$e#>;Mldo+CJM9iNxfgz<&nF z>pKTSJfd>2AVbhojdG7~^_jD2xna8<=Ar+#3TNzJ+jcl@%{1%;E1Mp1)0p}FHEDKs z95aMTb}@KPbU;)J>s+U!53gvbFRQZeWf|Oh3*Ud>J1KYhShF;# zx&srb+T-3`C_At?7vx1@e|Gq%ap&D;%cARyG*o~gW>oBhlB7MZ5%7&sm8<>qzI#je zH`fC`7)@1Q#D2A>SA57@$LbiFl&p5n{X;2{&0lv9Z1?#1_`|hw8;39?#uCysN-s7G zd9u|o=rr%unu-}KQIvhhEy90&_U(gHKfQU=LzQ~Wd?rr))A(Dg1o6%WP9o{oUN3b% zt9KiBTYh&O33}bOrC^G8oEhC`n}=S?47E@cm_+|tMi}N13{uZI%zo?)XGv-qU8O=&u$`I* zl~oTvL_VOE(-V2O{`>$i3q0t&hg@tZfz{jfLl^>KZ?~WsVlZ=ebDAlxkkz?;-s5$L zzS7JWsuf%>RrcoV4|i@+br2kq)4?+M30lAVC$sr>;XlZ3TZk)r=o+nO9vEYS4;Icu zneupqX!^M3JiyF-ddm;TDm{9uZZ%Ngq4`VK3e?KmCQX{VS>JwZn$XEcw<4l3d{bkw z`I~L_(X^FV=pJyVEo5fw;y$xepi6~& zq*umcTExOR7a`r%Ow-vdShg^<2Y;z;TVH<%PR5T&PP#0Rfks7^USO@FJlIJO(NBb+UCI={WOKUZmZEle z`O=fn$kj#S!aC~m$Y86*cRPI6*>AaIY{gLvwg~g>gX-j1|KfVm_w|*Z_B&HM8{clC zgF%%6386}p?tls9d}Q!)Uy?T&jv8^)x~jl!Umg3QMSXyYsi}{n%z}Q^C{~@>-MQGS zC6m8YRYVnVQfhqbjYa=KGD(GQZ*fhI(DjNFFq&1pc2wVe<@##(+G&_Kzv*GB`P7h^ zgq|*v`%OjzR$}cIbe3ewL+=k!uL9GIMK^q+FuN^aT+Y~xhk#}qB{Sz*2_};h>a~|Q z1q>K*y6wX%qmQhl;?9*i+I)CzdFSfH@%Rn7=@A``nZUAqp6tMdmF8Tf-a4_&yyu&{ zb@xk^ELy(%kJj93%)q|ez!c8e^TLesAWF)AfK1B$NhcmWMB2_L?5h&TYMFI1y$74r zLF~f+$IVr$^FK0WRVVv&p7QCpkul49Kihh9zsao<67wArJ<7QC5^MVOA)?;or`X=K zm5=D=dFa6~|7bj;?Yc~J8m3dPXT(dtmql`5i!!pI*;f&5)nlaQQo?-OLE}{5)9l;d zrL1!lqqH$k!4yp5s^0HNCHPpKfc%p^$Qh*smR2bm>L%f|o_sOS@J}PQ}`B9FO=RLxbpTt`rd$9s|WGoqURv#feaK&d|T^OI@oFYM}<%Fs$ z)rv`ahYm;$`DT{!k2N_-9dw|Hw~w(KulEU+lMmdX^?wVrVsra+))}MJ(<_{Ml zrL+*NW1F?$8+6Rv34j|Hh%74etAlL3*U@g&^?40@6}e9AsK~JSZ6)H`CK$+C*=_n+ zVZGJFeU(c%nz9U@EZTx>%427)!1%@H>Ep6-WXPNWrYeD_8gVWXU2l4eyS`<^wpxmh&JrlLSmOmslR*_Thi18552%Bh$;HUQ|TeyTzGC)x{7-MlbxxSdvsKuXGgR(;CbE4dBp|5{<63^ zJA0TBCH}+v?*Le*E%-~lPu8Su15>Nt^Q7I2+eBV>G&4SXa+3e(J`e?R>6|ZfY(q?D zA1?@E^6BJv+E(-%m%G|8tMhHiyb=K0Yk|JAwqrvlzuZ%->w6HIuKW*8cd8e=z?c@F zdXR^y&kcI2i*(D>w-{%Nn=wbn(Cg(r^KQ8T7!HlKyic@7D&8Q4wYaF2|EzzmtPbA& z0gauq_Wur%fk|p3vQwLB*5XjPe__%CT<-*)r)bBjx=g5~S4}J}Ydel*-BNn5GwtdH zJ_((K@@Nlb>b!V|6OJK!A>&aug?pf`FJ2thHTZ@4NEG(+)rL}gi4d)7&&ZQ_7Dqb{ zHZA2^XY(ALcYDt`Q$LDEgMU@t?y44~;fvKsPr?#&z z%R5!1AtYWPfqb>oX*^I>ewU@ z4*PEvfk!E7J8HkUQsA}9lbcJ;Q1H9strxV-|dnYjcG>2%A&5Gu$j_a+lKzBriK2czko@qA{-f8q{OpvljS+jQ_3cV zJ)XiJPgNV_(-3|Z`O{-UQK)4pPw-@252`(zdY+aY^HFcTH*8E|aERXAdMWaK45pJ! zlJe&5g@CtTykKCpMi?uZZBCjyz{dYMrYoD(v3%esP`f#~1;0UdX8;5FeaKah;aR>l z9aK5yb=TnfLxx&5P)K0zB5^Ir*{TlbickDK_c*?e0vAkFhdt2Ln&05vUOAOT8v>S* zSW5TVN38Q?nMtLJEN&_+i_1;u`zXt*G-8{MOzDO#kOYW?)~C8r;WmINzLrTk>$7PS zw+aDu@sL}NX98G?3y5gYeumGU8mmCM%e}g+bmn~f>wh7%lpFCScYjHCOJoiPMq!eX zfs0)fdN{*$TSIeNHOX?p^+1=g^owIdArW27c!{FU=2v|)Wx+XBD@auhi9IhVOtlNu za|3KAjY9O06=>d^W0O$sdTF{M3(ytP8|?Ip=P>r@ky~CMT9p(C7*Ymi{!!mhTfflB zx$ubde@Bj<+vS+_gnQ&SFXPmsPS85T>E0EM?>{Q4*4pe>d(}5hQzwrn7q(3f#8eb z3PLa=>ID^mM$khh_m$~&Kw1obPPEkY*Q-y*6nhhRf2;Q!!hlL;l?P$N-K3JkZ||)3 zvDPuAyTe)|Ju{_bilv4A%BP%t+~X1HV`CUJ}P~}2Ys8a zay65>e@6`wJWL=#DopNfNJ?%sA9TXxlT{L&HVJj1k+nHNkm0q~fvy z@ELOVYLv99rgtN!y$-760mCd%CmKw~@o+B9G&sJI>Q~S#7a;&&5&)JK#^ThI!VFo~ zRqx4BB4Z9ZOkO%E8Xd027hC8cZaWj+praBp038i|jA#?hlCEalIPdg2h-?9T41+Q`1{)w;08Qr&}j`~V?c5#gVhOC<3+4M;b^ znX7Ex#9r2$B8Dmei_*ARkIQf!I`GUkc5zDvd`KS1f`3l-S5~AMW0~&4>{#rpjmZ?Y zI_(HP3ry5*3~)!hb$;7B^3*y`m|!gQ12j_r5AvOkN@=faO!S?s;Qc$NRgZUnCJ=)Sz0B%MOEt__orhQr6YP$&8g&jOXlrR=bB7FXmW#S0%1Cm)CTNpC=w;sh2 zQ_{eb#$b^JX#ke8PE)xf&|;D2ZSgXf`_r38_uroHw6DC>Hb(ocWXST~wd=$U^A&66 zW_b4RLq*)c|G`ry9LAP?nw3;o*p~MwMM7NtZC51H;JFDKksrK?AOi1@;J@nhQAuE4 zS4#H?rncVF|8_}>*a@X&))~M!5D|~-Ew|$(4NYT;L{mt8NWa{>?=SB-rVMLj?9{p? zv;NF3JxeP?ukVPtukbom_Q%j9-G5*gumB-&q`GFkPAaW-yhlU?|G0h2c#>;3f-PR6 zb$YNv((Ab899wimd~r55)=Pejg=@w^tZ@idI4riwg!JjwS&XB;11XSDi-O!<)`TY_>uoq#nCF6CG%%5)$So6XBBwL*GEVS>OZvjk2#)dA5! zeS@_D`1kmkEElLA;Eb$a+$&)*$0zOiEv>iL9$jKy8D5J~q5dQM3gD6nV+WYp7?eC} z9TGuAE@o=FPMec|H)>xGNHo4_84T6z(gA>A8k2;2ni5S?Y0nL##kh{Fqu@|NW~>V8 zxr`NXi^sU;2x3@xnd`OwXOCPho?E(8bylqcUkn*6JRAC-Z@+D(-(E@e?jhsBQfheKwmX71?Bc<4vKTSX5kTA7?8PQr9Dcdq z_(}a!niPG(>f+3wp(RYHhHoMqYssBl@BirOkh|+EWA_~?Wo~;+d-V?>ofv>c3|U1q zZYr3BkXNg`=K$|K_(1c{=`Y$CFY~Mu9UbWGT}1W@zd7sszskW#e7lMo2^Tl$=~uIM zAVBLkrh{boZO?XGTZv^k|0}NAo^+?+9{}$Ambt(rIIh?i{;%0s&o7+|PlwG9HUF;% z!;+JC$IT9o{rY9f=o1s64wl4I+Nq;|Ubxn7|M8zmUJMm4@3NN(TD26cS_TB;VwneY zRqMP@hPV?!!7(`j$3LT@tY1%#vdAX2J@Cw7#uSbA@YxgHE0$REgvu|N^@xOsH0&&)!Y|v~j01U9;~vz` z`KTO@?XtK%pag@>S6bEyc9fqyrqoSF?Ew@2MQhM zpApBYPkR^X#H?p1&l=A*YDedNK5R#Z7hy{CTgvoTb&)XwERHvEBO~dyq<+!r)Tku{FUkB2RsKo=s&k4dv8Z*470|jx=>^ZYnfjUxNb5gU9zZh1oxgY6JgitVeX@M7Khra;X8XX^)(zZ}V#H=X2XLApSwMbuIc5WDMK{f1s*20J=3c9HrY%FLWjGdXgyf z9LA8DZW=?as}Z;wzLy8kC0!YadSF72D$sq-oF+Yd4s;Xw{opC64=Ez zYYMCEtt%xD7k_M^c{kPIT7^b-wycKA8k-`2&Bm=K_bEwh73{kepA?A_`|ne%#IE&C zB#?883P}H#tH*&Hp2bctDc!DE-xRSFJKWK&Ev_oJeZKq>N}EZJkUp;Up)m{WVG)5f z{PBKEYS50i7Zm%mJojFS!Z47U@>&!|p)salF0n#@iN%R|#@ zmd8)k;n)onQCzlwXn^Rfwx{gzkFeKWKA&0=S@S>u9uWi)C@Bh^Tq;UPT6pgiFIH6Pru&Dg3 zQ?{YITUua}DlI4@l-z~F3^?e4vI+tnH*1JRw;mpUEZpx4I%$YH^_Dze(}eq~9+Dn% zU=lio;X0l;mHqA;#}&mI5B`;emli8GV)5tO>xW7GVRM}qL*zhXuf4nuj$c^U`XlsT zEu(2*Wz!`phsPelCxSA(C>D)nrTtFhlFJ@6qvk8>N%UmC{=?N7_G1GFR9ABm=o)1M zEl&O`s#CB{Sx*y=J>u{)uf@=)mcV{5KTmc6CgC^KKti0x%(+LwT+@N`8CF)bh1{wC z?P4tXG6$676ljJSN*Ic$gC=?K0*DKwRqYB=s%U|7PB&v&K|VjZy1AQ}^~7zLq;_NK zkIu7BIBBh6)q@-@D!J%Z%_eZ3%N_ZpMvksG8+g!F9Mq|eOHASLpjTLG^p#?$y{ITPV z&k~q1%baA+4NiZ5b@rgi8OZH7WYkl@v!4}dWdztQ#WSX1mZzcPU-bL|L^&ie$hH#M z+=hwFubyxZ)J3k6lC$*9sFHnVw$scQV6O|K!-!EhMf7edsNn6D1&6h0K+9zkTk>uN5Mdy?5( ztq;v&LR}sJL?^I{9F=wgZ!X2!M55T#$sn=11A^PHp2_ds@?(VvDOTUgJ5-$qi9 z>kfchejxo_yv1u?X8(m>>p~DM91-Zmi75FU$Uf(ndjQ9RqAzl6+kV7T>WczAv)Qn% z;KyLm2%Pt(HeRSPyaXrM=B}qD8?bg)O~40yK;0z;(+e*agId@it}VXa&A?@mdMHAZ zjz0jsTeRK58?wpxm4W_SRY3d_mhl;yNsDIi+yV|E_2=Y{Iy&io&>=#YA4E?SARhez|Xi;)cOYGOsm4cRsc^)=kE_)%G zmzJ{*$)ZjhUte`|bvWRh<2M5|&e2M=iNjz<{2UU$VX&Y884^O1FXW0KT&!fMS$Qe0P zB^bre2h*u>uNZHDi}XxWK@+kw~&u*j~8dKcMoXwQ0#VQ;1jvu2?J9Qy)A#FIC_J=oR~ zs1b;ANXPORwav#Lb`es8d*J^;)vj>hM%bc@H7|twx<_DbZcT;HZeX-pcpaQs!U09W zCim$QBMzi(Qqo#Mdu}$#9+=K#y^Z22P<%9wg_)AzPXPHQw=J@o>#9)EzTYez&%044 z4OJHq=Lz`F!O2QG$x7p-zVI-R9~i%BTm+$r?$dnNU3O`F;8L?u)Xh$821p@zMXY~o z*{lA= z`ZteDpHq?6=HPJ0sg&jrzt7DcdNGf(VY)eUKt&{iut)?uspEM|4`~!=K^_3Ql;c!P z5AUPTT8#8nFOP|~)7cfLFGGS65nKjk+(6){M#ZPR&^6#39$@tm0Yn4g;8Md8^=rg< zUB!z8Ag1N0;q6EQ{$$G+{^EYwEg)M3nKF)F;hObn)*U+L|K^$={VY_VtkLWd;uQgT zrrU}&hrFBTQw-V?@bxH%#H?xB0bmhYl}b&oB6F^|`=0ik_RMPm*jOW=dzneUkw~bY zj~bVv5ci>=!9wfzK($Vl)fKlKIyp)Fx=wIo8gV4))0sq6+#BRE6@9-~I2rCcPzZUbEr% zF@~1ZgTtO%-@(%-+6jursB#n35#cixaYSA0@2}(qoc#pE1Q(0hBmgu1LKq@WGp*F4 z-t~{0!Gq}&x1nr2xQPM8@#GhD_NJvZ*iTtOnfOcPda*l>NH3m!)(G*?o$8q`@-LVi zf4)-p>`B$3d)lxg=S@L>=lUWb<_CSO-1djFsn;~c!IkPKt&F;GBy)TPHM;EXHwTn8H8>TPHfiA*?uw|_%4&mK$xe*~`0 zM)y%g4Sfm+j=1@d#o=1Bd={b#t_JR@+zxfSfb8a*OM>wW+(hFk8B{8ugM;8M zxuQ#T^k1(PDgDy`9jJFrY@qfe(XUqx%I-vf8d}(9A0Rk~J=mt^+;UMVf~Wo!Z-+e_#Ye(Z_Y9`{`uClyXfc;{W6%vDo*XlSvPC9gfch2z~Y zD6>xhwG8>(77F|op8zd62MD2_0FB?`lz$b895iiLQX@K;cj^ImjB9zZ+LN)5_$QzA zKNu>a4gaSFS~CZ!S`KL}zHHU-JpOsHCL1(EYbx#XdMzZ+%n+Gc1-$tqX_A?(IPh0i z0`I$Rym?4$Ihz@$P+!Syp8<1leLFx%dLdc-V4Cu^F z1$RMYAlC7C*b(MVs2;(?*64A@1v{^GPa^Jg4cA3d^`tTfaL{CC&3r|trf#+1KrbLM zM9lbAhXii3>(&1(pj6E5qOvw6XlyO!OEE1qO&`8}4+zNZ z{`O0@fX!qFxCCYwV3T&`>f8jHT`+MI&FKeIE`FgcC0RI(h^pgV66jlM zLE^V&fYMSxZBZUNYl2X5zh$k9B-LegyhoGC0dv@Q6Na&~kDja*aRR5m77TJp*1eC2 zcqdP+-{Ws2Gk|qYVSb6(lp;9+EIW1|%;n1YTtbeZa-+mly5*0=z#${Fs=!tsQLMnq zaG?sv63dpz!2FlLzYWM_eYJg~9RpJrYiHPyeCrzGGQOqmSQO+g>NwZ{P?`qwEi;fj zMikYbA01({DFV$YM2s|IA1?ecAdX7yR2t0z)yLnY2sSs}CtT)9nMu6+%I$7Bu#v)z z{yosx*NrPoCZW;ilH*;r5CzyoK%Mkja}$p&=pq7;Tal$`u+M5E%J$AB2C%O&uj3EP z%xBH+BL@o71_~O$>M{XqV*<*T_Y}9`yB)`+T({9;CovW=#XVcIZ-{2KJ1-6lp8Tnv z6lehY9lp1dHAw~ioRuDpKU>$?CS#yvNVZu-%Y#V1z8_r5LJY~_+LVQVyPn+Q5Et+J z+wAl6&OWn^5=X@0gIS<1tK_^ldHXCRIvS$J<;Lba7r33EJ`f|XF_Z%vuqSPKb~{2| zDXaAJAYsB-h}w&8LNPn02%z_v_MnO=7uN z`<0rO@C?uoms|D~x8_>NiHI@a`^Cp{;f)v>DkbV6E;qmSkj25c!*!q@vuq-+U9xXb zon7ip90e46`qTBvBxo{CYNf1!m`8X)C;J+EJ$i~%tzX^`+7EA($59ClYdW5TB7-83 zN*Rxj$8Jy1VYSS|l~n78xC@BWlW6%zfYMV$hvP|=b>I{NI?TwTR&|8g!Ze=*Z^Ey4}4YEeGu%Dy`yt2bY#(@|hf7wJ)#Ww=ys06H~JVp8wkx z_NE9bQ;iWr)3(9c-s&NrWZ%~f0}f3EXm>G=kCVr*W7N+I%SPrZH4M@PHS=kWWq!SV z>MrXG zVb;b=!X6dNc*%76Q3?J6`ZQ4X&lf9fSLwt3tR$frfDgYFI_d~*OX8D|X)kHfp%J0j z%EBpjXHpHaU)P|wWkF}J`xzfvM*><&ZRZ6qh0X~Ds`t%MQ5r?ax-cfScR|9Tn~z;@ zav7g(FT9KBWVXdBl&$TuXM7KERFCH>py`v(b5H#CyY`1KGZV*?({+aA#1oO68C8CE zrRD9t2Bh_late<5NzyYPqM~9-A&Oxaocthj%9!5~%SrsO4#6R^zwzO5GeE{Xa44bJ zR#oAJ@v}N6to$5We}8c>s^gO_bq1ez&g!&#-SO|~A-{}qrQ&;d3A(n`ca-lBCcMM! z^9ru71YuI$D%d&Bj8Fy_FDH5AZjypzE_ht~=AFi(? zT|brgB?X=LrLO_4)l~0>$ss_K!Kr26^sdl75LdIPYh$?Qf}&w=&2R&enR#CSm3a+j zCc*VS7wZ}0dCYe5z~SZR$q+i}v>S!Xos&gEi-3>PE7?7Vf4=Z!_1yX}nGD(dlYReA zlI;(f$26qEA75jmB~#ml)-k@9blVu9n@1sk3Pb^*KFaK%%$bmDyZ|(3Pp?{HE6LgJ z_}%UOjF+7hrGZoZ{@u$cV>t+G{@V8QXL2t!tTHtNZOgj%JW>}ugWgvB(I)54mrAIk z4{yG!NR{FYv>}rR@%!r$xb~H^9v>w^{1+DlN+96g?&C;wmjaP7Cn;l9V2>T z1zeYlM}2a8TkEV$y>#5$a=xYnL2?J`s#z!d7WfR{)nqxBD+AEq#3xO$ev3NEm5c*O zO6p)+-<%#O^+bUSTYapu8{17MP*cinASU^lS4&Lo=6fp(w)25Bc2?zp$)v>s$F!uh z^De5(-iyA}zuG-Q(J2_|!lv3H2}kY6k9()(Qc+9-E)UQzmG2L3Ex^rUpc7K4C_9KJQbaO+jErS?BMSz!7_%X4& zz|Xc?g?^@h0U&opCD_n=TH3`q9No>Opxf{5w&L)yss$ZW^47T#2EmN{>l;UeKF^B` zi+_?P)105dU({zY-vIm$rnVQ=M9Hp^Wp8J@QsY#P_Uq!HIHS~^yzRnHGM6Bq)X%f) zhZnZ^%*7T*dsni&+2Avar&({WwC%^nJHSPANNonK%1?tIJ0UB-*@k&lZA8NhMcZV| z+!zBhv47UG#vG!*>zTK5va7@ zewLBPVRTJ{YU||LV+zwvdzW=b6pO1V|l#zJet!V*Q_ z?2^R|gBnhBnBF&Ba6*1G?)Xhks}*0>vGB1+c`~L6*~dFstWWzLd!4pvOAp?n8yhg0OE;=B z)0h#{=v(oAtjAbd&8#`XDtr@qT8os9zM3>HC9n>(NKB2qyyU2o0ffjyfh3Bx?lh8A zo7u>^j~TmO#oQ~Z{`UlCzvx;jBlG;K{-_u*Z&~^pkX!MEF=telR4H_=0IFX!O~LXi zem)M+vdc_r@cwrIuGBA6rKgdV?l3^fY>G&RVA?}?CWm@@=lFX-04GUWMaaF2 z)VH-VX*Y7=Mny~lNm^uq;yQoKTj?Q@R?QgJH5$jRGX0q)7kb4|h<>x5-K|e5BTGN0 zp5M2lED4;pfc}7NJ-bo8xnAhGkk_Xoz!rXq2nvfp_oiCQN5HfLP!-;B&sIl9XcT!j z7^%{rM>3{^gto0z46j@60)VGj4&d7zNv1O*F}alNBtda*KGwBIB}ZY4F}mb?vtw53 zYb-A)jiMPPs50oMr5mSIePd8O*rRuQm7*sfVwx0%lR1Nt@^w{!GyNGTFlnd-c=~q1 z_W1_d++VTL+->^4A_Pp|xF;;-SKrkBLVcu8O9|mI^JmjiX_H5J8NBst8=21VJ8_ya zUcvi;^Xth3`2;WSY!FBA`hYp|;8{VGLCmvHy5;sr+SjZ6PB@6TS8x%AB?{7HgUkGE z-Imd#tFGhv zRQhRm0l-YTK`$^lw+C_-5EVjb@@&tfVe|SpIF^P@R$1=H5)#h_4?SjnXGO>Lr*)fO z-z;Y`NQL2NI%MSjg&dd3i@Qm2(-k(?i79@_YM&thc)7pwYx`&1_Ub^R2QLmA5{-?P zSnE69Y#QwyPxknhBSn?LC*HVY3@B5ddA|44@XvSu>yZ8pXQFWUNrNZq?!$5U-_Q8E zNgJ#N=+c}&T>cZTt!;GP=jrt_oa0eLS5)!V0<#3~`Umi1 z6YsowRzFtavK6|=b3d6RsL)Ksbj4rrmG>Zi2hd9Z_disL&4(Wr=3zZu3;bQkBiU-P zPPtA+-62T9Z-&h_^hGh(9M;-Gq>)ZWkd^5H;{G>&#UoR_J<;Qf)KMoI*=>4}>{~g$ znvDawxdX98U=2NML&s47cb$B;0kWiI$ljv$V2nguhS%X2ec52MB}(IjtX7t#O13$} zWRh4;^|v;4HsRDZJf1zDf~0?T0d#~&&)iO=@JI3>laq$$>F%us$om3`HuB!NwV870 zFo1VW5sMy4?Il+2o6|5QW?d#~f2`@KYb*hW-W_+6CQ%bHZFZYk$oa4Wd-~BFs>2$L z(8%lq`c7}XZUj_ApC&diB6!~(Ms<`)wu{JA+!9zBOivGA!dwbGEufg^(y>#!cYVC zz2ELTV7=#k*W)862O^K>2R^=FJy&*OW5}0UQLRFv<_F{!IesP9G_2r2Xvt5XXG>Uv zT&9&N&dgOxi&7n(2ftblkxk4$M-f>GL1*#TcwvptCA62~(~<&`hVD^B_RTn0MG1Y| zhUp*QN5Pjc*kRGOZ!!lwF5@Kj2nzXiDOYm(Is2 zCb_S4{at?R*dm0W|3z6-IlEvN1ElOv_hpj#tq@qnDi5ku|oh5OA11;*)h7U4c> z%x8S^n~D6A(mO6YO%23Xee>^rc4NrR7K&2N*`g6Gt35BQ`>X};_9WzlfOz-s%J_)G zj04I!CC1#VR~j4-%s4W|_^k{K16a@`RyV7J8w?fO&zRTC;P@(XGM{}~inV;4=$!Jz zShHnW0hn$qr^Dak`v%CqL-Kd$krh%yWNBmGBCYyz4##HPea1E!2m@M%e-%mCQz(DlxPB!=pWN$k?C*%<;!hqyr2|GPjx7_G`fU@;`beRnJyGuM|^!J&352YAFcJJCPFnUU?pr+dCEv^LaQk}UuV z?s`Pm&2KZTZdQ|C!z>=}>l7FImI#~R#SNSUKuq8qR5UdAc9Gg?Y|Jr*bnhzX>`s-T zNC;F_Dy=e2L5Q(YoyT{f!6L}6r5v*dx8Q;Y_ec)d$;R6tG$7BlV^qH4ldwUwEXsiy z(@)W=Kb&$^kz%#(@4hYtiVMD_$&+{yRoRK*M)+6W1?DmS0sLhab~rGaGEo;qrd1AZ zJgBT&#&5D@d!}9{`EwwETf~vV`^uLPUEGCS1cw3>Mr2t32rCR<2Hsrmor8K1GX0Q4aCN@z|@r<^esX&D465` zcuTF*uf7yjH%6hu-@zVO(Z2$ZGR3KeRcbjsY4s5JT7i7o9~w#9lgA(e(lt9Bf27sp zKIRb6iDug!h)PT%$l{@3mehn$m#Bl#c)?~L8;C~$W4cg6nfYOx?SyJvkxVf?OgX@B zRV4|&ThPCeqyhGKTUYZIG_(J^_mUamF^lZBkwmXUt!8=T%_e1od4VIhu+;RX&CH@G z9jZ-ai}baAaWfmtfuDtFsO8}kaU2VR9hgJa&gzg5Foj@Z1~&8N`-d^S-=bya5R|l; z|MUn80io(z)pOBPyRBld6hDFPulCQ{enqi09&kOIn~5lDp5e^599bnUk&ATnYDnCn zwTzYp(0A74;suPIqe{d;XkXZ+AaW1bJQ2t@`$uQQ`B%MrmoM7h2vOf6O;%BcW!xq} z*Mv+U~Tp95=U9(vRD5)^3H&zSe08%Ff){NNCz%@D!7HM*+bD@9- znnhV?%)Cw-WT3i+NWhaA$w_O2C}!0G4faPW;Q0v{xBY4ykCj_L*pvs@WMncRK&STPgmq2l490INg;qV)wmAbMB3 zFQbmdl@W5Wq%G}6IZzfICY;b}woE^`nj<8^6pqii5$in)Up7AMSpUpoC z&@69;sWuAPtrc(K$kyY4G2!WiE?L-QYHQ5teZ}DacA3=0jX7iN$xtES5^)N(mcM>6 z3xm2!gC9dPN3}qTwT@c9ZXulc@(Et3+(SH6o%hTFH<5u-Bo?%O*|Nkls4M_OwGuAW zQ62geY%gp7_5%Mn0Z&iso@TweUF`n> Duymd< diff --git a/src/webui/service/static/topology_icons/laptop.png b/src/webui/service/static/topology_icons/laptop.png deleted file mode 100644 index e017c59aea31de5a9112ec89e5cb4d6cbc009ba6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18192 zcmeFZWm_Fh&@GH?VB_xYn&9s45+Jw}+}+(0G`LF$8-lw#K|-+L?!nz1-pT!(=lyd2 z!nrQs!>0F4O?Ow-s#UA!i<*ioDiRSA6ciMyyquIe6cjYezh5vs@QF`AyayB%1(dv$ zxTd$!i6KG?&H!F#L^KS1Xi^GI!C&BqL=yu;O-i#LBr}S{M1V26&uc|X%|P+NRoykI zsDMVEiVy^<401dhw^voYQ}UW%5v+e&h2c+E-yjm5u-TgCXJHv#oWk+G3Nk6uD&5Si| z+k}7vBu>$Zk%6*75WEasp{d~DdMF2G?kuKIIkBxAfz=@`*)1Xzrd8gqAR&yTa2CMW|CaLjr;7T4 zMu_x$=ugy~FK%$Oz1d<@_xZ{_guQ|8BV0(oM8O32tlIYl={fOSkeV!G?B6U#Xum7alIhdT;OE0$_Yx^Bhi{O4ZBSFtpl~ z#r=ur^zPu#)eB~m0%T0iCbut6r1Y>s9N>_pbiAH^KYe(=GeJ{AA|ov@sv!N*&Lm*Y7`OoKmuF)nzc`kU*!U`gqk1m4qaA1A*UN&KD3z zgRTW|hOsX*?+erqgIE~CQ+qVZ8+W~)BS^NInR&i1Z!97T=@Dj8Y@mjCIaP$c=T;z0 zeVr!qA%9!CKXZk1Gq;@3;(Hq9gh72pE(lS#?ZQaojaAjRsq~PCB8DXu5%y#k$!NcA zxM3wlggJ=oIgZl*emUS1=XguPA3qf!3u^E9wgkCvaTC76xP@V$4o_XH->MI&vi!m{_R`q{KnHZ!{YF&Z%SDK z%Jr+{?p{3GJ6CyqB1gI-GJ9sG1Al@C{l@=oe*6*ccy-b4eDqFH;{D0ZQFVWA;|S=r zNtH2G70fJdWo)Nh!oMx&H9Xh-=QWAW#EXK|yPPCOCq)=Bd zo$ka!28eM z_8dv}GmIQZ#t)sh3Jfok&62Ku=tRjf;am~~S9!w&1-~3?+=*-0m2=QKy`Fa#?%%4u zRYzC37=JC`N6BOX=Wg`H-$q2v_$eU5kG=Xd;#nEXKg+;qwS z3klHRo%NSCT4Vz4CfgyAnV{rE^R=-y!w>rhy?mZY5B}7x7 zA%Rsp>&j{bHi18rjc2NZ&+A@(hs_QUv-`_AF2Z|wr+|diKjw@BPrGk2b`w;2j+(#o{w_h3G1HLi(Po!Rz) znjQ^v{LP=ONB-hXbwF%Vob6d^I|DOylK6`fpL}FULAX*0{ZY^=oz&B9quqyiJ!x$!va0)#mVduRYz|e3v8hOjUm$A0jEPtlsQPN$<{$chEa%64NtOpmN;HaPij*T`gqq}(6%7jTb{ zgE(DtQtRB`tk(pD_y@D6ZD7QyB;_$cdA3Gys@&BiByp=<$=ToLS{tC~GPr6UV~wMm zts+h*v$`>$o?$mgASoAd6yZDYJJXsnc4KZU1@IgRzCM4C2HvweL*t3$rMdq-{pQB* zx_D-k^|dZki~vTmjc2eCH<}=5y$+ZJeUa@IiMdWAT@-8csUBY&oF-BeHQB7Vu5!XG z10%lkD2&+;lq}71`H`-AM}E*9`1@s#%(uTktJvl=QJ^s zk7sBMS@h{HmFsUExXu1MtFw_F>+Q8@j!lz29APb|t?>-*f#W^-U78B)y=A5nI*9J= zHkG9&p2$(|_xJKRK6G3Ly<=))n5R+kZ()TKC~g|czrir^;JHMS^Z_@sMchrW8g!YLYSO1~6%9d^{Fu7*(~+0%CBKE21uX7er}yHhsQG>)bM94Tf*%?d>T(Qm+EpfPYd+g_7PGcHEZRE4$Q zC82YYbGT{|41Ohxy#0&_Q%hm8<|W{LOpfC>x6boZc~)^NOeK-KX6;mmxY>|UlW?^< zMd2Y(iJP)Q$C4x7qj8QE%A4m8&0Td%!p^|yj{yF)me(?qR9Du(Fj9oK+o|vrTu>hd z+nM0lVhi$o0N((<0;{n$?48VHPuA;3V@sj6+K@w=I+GN&Ja`2E`l7n1ao19Vv*~%{ zG_2*akv&h)r(46&y~?rw^Hw$W(1+hNhi9$qr4-0EjXMn9qra5Lp z4&N6=79t(c^8~a_0JOIvCjSC(I4GLNl_pL04 z{pW#LP=`99ItQi6s#l$cmb0Jm=%tdX*V2+9g4)v!urgQ=<3BG;2o;DM92H7g0U$-? zpY-q&~qH6;YUk1$(TQjuUU! z3`W7HapNVra?ps@vr}Y+OwyHqOF_JpR6*dqAB?)iCcmF>>OrYDGKk5A0=S{&%~ux+8ZOh zP$OhyZ9%ih9!s=1^BWHvWG3E2BB%O=N&)wQowxS0@#+$W0~0PX*IT*zp{t#-gihd} z1UFJ3g|9Nz>2{Z}&2$$6Vg0Tf?fX)&)3%U;&3k4llQ|>u25VR{f`{*{1f#W|-*OZZ zh3b~3N|wI;jTq#4?~tNi_WeI+s7{*8`i-J#&8EK5#s6Z}!8Y7pU&23UH*=}n;s*X` z+Yf?%1M6_k3$a^LisUt~X@~7TB_n>!&>66I_guS*#!SVl5m8`ldkoL0sPXS5?^e*W zJLP~+xOxs3R%_2CI)(Q0JvQ@a)8<;)=2g_Khm?=t_SQJsEFEcg^CF5mJWg{G%-xF# zqOz1va|R!!s;>hXBT_Jc*}5_x{@k@7{r^C_JOKxzTdY_vh?MQcDGkfY@yp=lOexOz zHCSk}g2Ojcec)lXr;ZG~xWl-w{vBtnlU>;YB*qBQ%xFrgsNuM8n%0{p+z~)Czv`m? zu_bBstK-|ldQfTI?-B{=7tVVQ$PKx(XA&HgT4DiI?3UQ+=wkdYaU zWcrX5dapU9$9bWrhL)l}n8I~yt8d(fxR;-tBz;#NL45v)_f^HUwbE&7Bq5o0^NJ9J}>^@{!uS^45+ zemZRTZENpyNmPpZ8Tfw}Y90QZ!tWbCJE_b=HNKsGD_>U!M7&0!lec?lLXZaG8$Jre zo)1RLuF|7#=XrAY5$K3lb0dftfM21=f>#Gj^F9;Qh>c4NFG_(MV zn{6xcVc2jU@EsPzc15OKCfjq3PNAogNx}*FzGeQf%Uihk8;=(Qk9V_NT7p}{L;e!H zNbDI&;Sm&e>0RofmjWLwq)-Z52P9cy1-k$|sAA;J?ivkacTR(1rNZ!cV~(vS#i)$b zU>(ei7iT-oE#J{~r4E+AzM0wdxQgC>Bv`E!W1vCj&3WZHJPz90BTXrY>gdUJh z`z!;$3D}rq4rBJx{is=PLENoU#nqar4@)H%F_0!4Ra?@AlUk6sa}0Ij4t*7T%()@ zp{5Xd2XQDi4pt4*klUL+RPR4lfBXL|6K`i-O2>NUaMk>P7ytNKQ@=b#L3fEi149db zrBLrk8%n6RicnuV>H|}pFMF|snL<%8`z8om^}j6Yd;!N_ySvD>+A-9v|5ImO4;l3w-kCjxh`;Co}20DljZbiDn>T4aYq~@vEqAtb(CvS#+PM zX(g!TVp!N{<0gZQZjK2q^e_fmPFK;<(ekkG|sI;`(ymr9rF5}6?XpcW#oJ=HeWbiDjFGP6U>&# zh@CY>;L{665w(1UaRz|n%OkUk)d@$)E~)g>=nJyxLuMSop><_9$eB2s&;OYwS_oS+ z-DTDGMIDa4%5TZF{X|yOB#pLU#={&yVRF(vWg!C^R(T>%wLS?(2$pfh{5B@aZD+PK zOo^g@o)Z*GG2%Y82S(I9kIJBUG|UOPvUdod@KCLCt=4~lyY9S=Hu*3tz7NmMh>aRj zuJCv0?^6{T-ZmZo*@x;~8Q2&H$Fq6D)^Q%QHyd&$h_BRqxKq>*)mJyPq>`~8 zYNaH_S5(jHA7vB0eWqt8^9^AK?NfQ8j^OnhG(VNEe#oyU&C z1nnm4=18UCWg#Daj@iL3G#Ub3Ki%Wo;v#+BTAW3=V4zU?V}zfwV%nS4wvrx}&2xnC zWt_pg+S23L?za1jP6sVP+I}NHBP*BytYcwBu>6}qTU6$qw{71v;7}r+ts(-N7HD`s zn;0SLmtUmWDJ!hO0~cPE-2VYdL7A8@?=m-%21&wGq(pA=GNTdGLKn_WO=d;Cx@|@_BF6t3DhhH&&o1PE#U4TjzuC)2p7o!8A!y8*Ik3j*a*q>RsPn|r}J8&Uvpiv^7+KQF2 zN3FN#C-O^C!Ya>a|8nMYwVy~K>}m~XN|2QD=4OmJn--tOIZev~3D{Jk^T&pd1=ByY zITh#01bu$%Kzs~}d`{GVTS0@6a`Ul|@)UtRalH(8e>`ODZ`ish`$rzI4;|SgRh>yW zjZ2|gLZ_>EKp!AgB+Cd8Y*+6W-IXpdFHJ<=zuHXa7pRv48HE`}i(ZB9+QQ7ZS|(M! zY6fN($5+OcM!t9n1EPuF9Dr!rD$Vq-7%YLhM(6raHvv8t_Fd74nIj1g#IE)|)I_pE z1d%zYBTg8RwgdQ@VO<4wM8Os+Pg9}u5YPHwEjgg3VkZnAoGA9Edhjc^wn1~R+xZF7 zusFfb2Dw>HP*+DI<&u`dWY6PCwPcG~aQDK@(_y+~Hv^H5haz6TcXADRuw9CJl_+j_ zjml34fTw%R%5?P~dez;oFS~xj%f3@U>zif^$n1)-P&G_YWL28&(Q73%MEKCV+#cYr zA<_cA`Whm1Is6=Qa@ywD!D~N7=DRFo7%qC$ie|yNL5EW4IjCD^$fa*4DJ2W5^#enB zV;80vTP3Gk2m3|1HYY-{%9{nkQV;6BPpqO?DfZrgLrRdb&$-Ed|InSnJD04S8uw1hf6yTNe+ zg{MG6%rg8=@HCmy$or}P(BNDiH9L!@TI?waVe$SoxRY8r+TJ719$MRVCd>#h7o+ z8MGSWN&d8KyYVvo#AV`1q*KX+Gq6!*;}QvF%Lu`1A+W6ZjFE=lAe1(%muwM=?RunL z&vv@^SvS_+k1fCJ*=2))se|kHwp>vQ1x9@EM_9X!(b;`L(^A$SqlmOX_{y`_B2;ZQ zNoy}?#X8~C#^}4`7CvRNsU(MCV^dp7_{nheKCqBfVUPDy14Q@pr;er@oO7;iOKk&VPGV+2Pgys zG+Ks8Us`cKLt)%|{XY?`-Rs^T#juXOh_y}l*k=dtYTZa(LHNi+A-tx8YPYTfAontR z!BbXU#xR3#K8<;C%!SqR72O*eVJ^=z-A37om;Xqh_0?6BxcAKV&jAMj%lkJMu}kf6 z6+mcCdW<^rDzN3YiT)W6YM+rVQ58y^Iy@PG1_FEfPUBoG=_izLrtj8r!y~fa+;s&j z31*2)x8$~6b4NS@_(ulrSA?|#Fp-HXPF6DD{S7E$x{#E;ujrH&-lHAL#CmpRoN5qg z14oVa=r`X+?g`KS0sJC47d6|oq4Ct_l7*M$8L0%{-WlUJD88Xe>--13e}Kg&>QT?`(3p_?Hjvh;k{?X|=13`$dG-KF zQPE}?qvM1b`)v^GbZSr30qQ>3TCp{8Ay0d%Ep1X_^oSsT4zGDGz=OmCMRK7g0c45+ zsDa5;V|DjiOMpTan$`+-P#FG{`yY;^I+sh1_C7sqkSg{Bh@D4koi>cYm1Iwb>*sz8 zZ#x<9^XpxF0ZOm&dRXN^NQ#*{-UMCv4q@FsZo^!PKPvpwD*q=mnTK;Hb|=eAw4=K7?83_`=8wb5d+73qepB*PU91C3Ig_zjEb-7 zztcGZW;|Q>LI>a_Q6^+)_KO;qodKdvs0m7kdiji)om>(xN?_Z^QIiP_17(ZT4%Q%- z(|EIf8|G4aqxD3skj}m*#bi2>GWe3Frc>CHWH^MUYrD!_Tz`d`zvP>uA1En>1vmlpBP#HQv@=w z2uL!{_Or$UTuY+ckCMjS#Nm{li9kskhF#SULI3KaD;kT7U3kwQ5mnldUk*csAs$Dm zkPDR|F4PK7a^-+ycol@>q|=-jo=HIf-bW|`m@5=;(sO= z{|mX#r?qv7m|k4sF?9gZYKzwn7R?~hgl^DQ2p}He0t&;>ywa+FgxZRAp*rj{o&Ufo z=l^N}1UvUv+?-`kMz*<_Y-BK;WlZKG4Rva4npr>3i7aDAXm~6E`O2}{gMW>K{|5|1 zWlA)ofh2fj-aSHlN>5`kfIzcyvCv_ffveUFGZux^MsjahS9 z>$@lScRJS*TU;c7U2?o2GJ72|)`sYckb&{$yQ5eGD`NQxn|wydX{?8ugibA0hMqCt zw)`^VPLoCn*gvL}B&g2i_k8yWq+ySeR$6NwGcnL3^At*(%{zghp@Ru3XtdPJHbHyT z0ljRqk=RIJ$Z3P{gx26KkpA*KF8E#ZWlXNvj*S?FCVGW`=HSv&V4o0Iq6^2x_Ge7} zha*tO^rWjQC71>eM(J~#pBVlpb2Td7;-+J9H)7+eC}M3Xat#q>D4!H{ z1hY<}f45emWI5CzP9pq2AQ^~IqmjYfl!s3M>d#*@ASW$L0~@@m09k#`D;BsTb#N(j z1v&K0R!|I%5(!i)9Tr~5aurKlvoev+e2@?>XCUfq&(_A+)G$<_nnL5}A!$U@fzO3= zSwj>`*k&YAC^@Y_zxzJ<=(7uhx*>*~7l@_nud zc0S4qf)6u#^BX1p1)1-S$NTSR_08=+mLbD@`O=f}R6UqFpb<`+3lxQya!`&M3IU`E z%vgQV(9)IMR#m*g2a!Et>KU`rTKUeO^dOoK-n~@7O_KDEx=NLEU^ir- z2E2|JzRAWCd_yA@z%f7iHw8kVw0HWE)Uxp#op)=JnH(1TbFl9VcO6&0Aap+FqHo9m4={|6j%M0T0r{XM6_3na$$-9 zNdh#Gh+qd&Udn}_PEox(hDvq+xt1mfX^IjD3OyU<3oXGGJ6w+jR33bd0b^>~hzOcC zFqH@xjdLE*u^=@DAp2s6ig8e}p^6bhX4Xjn>{cZLPy(B^g6syl7+NSB5S7swA>7zn z!qWF(8crBvW=PADg4e$&>QZJ+&RtV=xfreqs3G8BF0MZ%z<>TnB-jVe>ovoj(*`4t zioW^W6I|xwFF2u8>OkI_7dqyB)@!E*eAqkmlT8k3+)m)KU!_Lw=%h&)B`FE8Os%}o zb7KJ7!mGmgKGcA~*Np-iU>B31|Z>_$=Q^bW#?xeeb?)HO+3Z zN*+INaQ>VFzcy1;w{-e*$ob)FCDpkp+b*Tgk9V&2T@OaK2pSW0zpvW7jCI;>C)rda zMjAR6Kk3JYIrsG!@?gi^*Vl(T<6~i0m<)+p9s8H9)VQ1ayC?=MBYe#ad4Njt zuNeIN0yN*70yZ+GZpSIzP#+BF{Z0>Uy^G|fm-GGN^ihz0^6M5MculYUY`H1dz2^_z zvb*!$VJkqD=IL|z1JInV$5hV_(Q(KrZ6{?T=bi|Xw=AP;xd5x|-`(#rx|bJ#Cvv7v zo`Tl2)YYxJ0o;RaJKfo^RBVws+Q|BA>MF9!>7ZeY`7e_5h=Wf~P2EVVwu^i1vEg?Q zd!L3D{IZslJ{7P66j84T+0!4rtNXOTkF;YSn@>bxRG8cvbx)!^f;QrN-JI{k1KL<4 z!!LUwITf@2^dosB^SIM7X`{b2daY*|R zYuEM5l2-6&o^)`e7ttx{=_&Vc_6cGQITE$0y*J@y%s+Fq;B%5ucgpxQ80pJ{ZB z)BgQnm1`hl$}g|HM8=1@XG&z(?`MsIcVYZ2&E#CSWe$~YaY+OVU3hi*gk4wxPPart zf`O&q``#tzUJjTw`>uKHJE@`B03sLrr=8z^_IH*H0U!2Te4Gq@Hy?U|KuI=C(-~t| z$rvOA1t{PyG~%2@+7a$52}QRf-2I(1;dAo20?7=L2I+a{B}ZJP`w9d-FL6#ufeli* zLUOxIxQMfMphnC)&w_iKy^P>>ZKy2icq=A(@Unq7;q^Xpbq!>JTuh_NMy&lcw>u*w zb@`{q{lfuohyHc}d`j!ucv#SO z5OqbP*o|aVcRPD0o5bl&kM@%IPHxTMS_sTtl_wY=Lh6^0S5s+RY~pBc@v-OH z%w*Igz1s4d*`|BIoLs#?P=NAU}Zq|dEZjMq|K4Y#Dh2_^mo5zQu z<*N+E8aHj1?xsf6bR^09rqAmo7yU@m=~a^{RzW?YhMKdGtyKsk%3#_Z#Cc4)}r30qNUv@*F}R z>)XF1PGKFXf{2N_>sxvV0RiGF!2_Uej(Z(K);($J-Jx9tL3mB#dy@j zFVbRVsbT%`8^OJgDK{3&T|nT|h)=>vq1%LbR9X7cDf;COo9_VKSE%FIr;q*RI$h_f zG*4vBw#Yn7*UDz)#&sCBhD4Wn9Bms+=8uo0I&EV<3325~@gEfn#IiaRoV|ryNL#OY zj~jKz;E-Ip_uCW(?3)Saj#m=C*fj}k+jO4Ew?sY{9LV`SR1R*0%fuse&!=g9}}_dw>j_SUL@1pHGY%> zWjp22M--@fUWB;y6ZfL_CVxz>4wm=)6rATwkfVyvJ^MS^C~qwE+k4Es^R2^|;7^Ub z?>u>bNOWoFf#7sY@`4@t-f|7eFXr#3`=fjWR4X-Kw`JYLl~%R}ee-k830t9o@9S~N z$tDwnxECw4n<_>9e`jr&C)YOztwa+I0C(!WqSz|eC!%OpZb8mp^U7(I zbA0SS@-rOWsVt`6fkd8g)_J1F2NONWJ3+an*+PzhAfRHOfrPP-!dVr7=;Pv5`hWDM zeWJy+Q^FC6NcT^P1Q1eL$D^z`&wD*wIbv@&c)DUKc~I?DXZC625-bO^b%E$*@W_AD zS)6quDe8aV6uBor4PT*k?!O0y&bytu%HhAuIR^TU=Lcgq4u)g|s&W%|*d@mSIW1QG z-XiS;zpO?4{RwZKG=9!iMwBeDsu-cQ*-CM=ZTtIaPk&Wo$qT%c=JR;*)SgJhNMp`0 zV=Zdz!t0@Uk2G4z9(mO36v(BbP?4Qbaui2AJjpsmoIZ4}%2gRlpRL`5TKnZMjW^J@ zM15mw|3k)$?nq+{x%PMd{y@ZDbO3ZYme$x3sX)6gO(WowS~n^S^ZqvNm@@AU8%Ryl z!yi#m7eWH5<4-gSk;9tx7n{^;ya6IVC++g`ox|FBB;w5QBe=WI_FaBHq_RgO#`cb& zm=%x6_QdB4Ma1W;@UGadWMQP~7x|}6>v1-`zJn4TReruY3mR1Bu^cEy@pGo;CzSEq z=IGxY(I+k#-svTA?j4EQrTK-BPD$@+O6*8xFi0^)Ic@9j{G_52>17F-2-80-yo#gP znBsBqNtCeXQyKirFAetR2olaCYX3Dk#HfAC8HZb8c+L@!D(7C$d+gpJNj)GoWtYdE zq9Uc+xgQakG!(HH8MVOnE4!S!eZuI<1W>%jc?rxR`IJsZRX#GC_hd-00*u@Lkkjt( zzd3&VoQ!xE;+?!Bbc8a5kRBfhB&{CC>g0IfD$<%Io{H6T}`d@90vK2A)@iMFdOt$md# zJ9V#F0A!XI3tq^RRj%wqypB1M6ac;8A{+eVs+wRJ3$&uiYaL|xoIeiCrY`QY8}G%r zyeyQC63 zj%M069ovqlab_FV4$`iRCg}z|&7JB#^UkLfkR@9ssrAaa1vp{asGrd4ljI^yD-cgw ztm+-_ph*Pq-b;?w=J<{44lbOyH_P>Ca_+!)=I#jcTC5ML6eV=&65o>a2k}q^432%n zQ80Gzs@%nMffz5WfiIa7Zx{E6njH56ovX*k355I)BK8*Jv!C7{KN$=9q%b^1>)(;0 zm7y)%5Zf3h-VH8+pQ7zqr$mTxb@(0iJ8)w=)lR=G5%SJ5){Y4`j~kDJ?v9UR9RSht z%EBGT^3k;RCPaQbXtHvvvMXSQT%eM6$%UR{1>~(ZawI?#wxWrw^@4$Mn~K2&0v0I8cQJqs$Iu8 z<}$LI-``|A>pWQ(P^in5YWo1S6a3fOV9IJb6%1TLbh5Xh50QLJuwua+hrMw$dwz$a z4&kbNKD4q)l%7``GM66}CJ@qHyHc>4fIS~wIHJu-8W2Y%4Q@${iKmeq1(9{6ALpp~ zBz$EcBy@3zC^XH%7_$>eDkvnD&k&1JDfBxL$s?Lv?GrFz`XYdV8)M0!OUrEvp$qpG z<$kiq@T&6OSCt&Fk9&6MOOpv`W{c25dYN4TV*4QqY8P_GtWRx%psU*ty;wv)w$c(jZ z6zy+aoyoXk$;jVNZ7s{^RXUuW{oB6J3rX7lV0WVbu`h!~$419n=r^gQJ)`@*uXJ^U zD)q-86oIz@@50GoPD*|_;3pY#Uq*~iM?L|1)xVzzPU48=$J1+F+_4&vYhA83rihnp z&cXomvTS@sTN0B@rLMT6aq@oRGH@hose)^359MJbwEbr~famcE39Ku-IcWg#+ z;6L){>5Y99SXmyH|D?68_AoqBU{T_deRTe4+;SWJHN7x*--xD z*bfT)Lrl`-i zE%SWP(wuXlhx@n2CbwB%N6~jdNr@_#g=^62Vi>=~Kr3>6pvXO%HeUB(rxve!AysWt z>^e>@#(|1mL_0)fol-wXY~N&&>z5crf!@jCZzi_aa9S3iV`9r`%}+xK3QIds{fTO=S48d26xAi*kZK-G ze+S(*!{Cs;o9mFE^C$?1zVZ|vtHs`vS=ziO(BrGR2#A}fso3R{S zGv|Kn2&~<}_iv^Wy09y-54jrey{ar*E@s@;0Wx>=JNHKqHcOJj#UG&#yA+O98m~j| zq4?ig_cj*o$|Cq(;7=2PI9DX94GllqD2T=Leqf) zG;axkT;AUgVXwe>6%z6eIoWf^>*|cI=q)!-#%XH)b#<}`Jry_ybz^CTwcp658Hm!T zCs@&Ki5_2yEQyroBBUPF%MbTWlY_(Qy=km0@0&Q=Y*4x?6CFN<=>u`1-Jda`t=vYA zN~any*L>x1N_m$jqQ;=oO*x`r4j*b`Sn8M8^(1zQ^V_e6>jS`0 zV3}y~kVtyjJ&r~)XA=Fr=tS%9ntDOIbaqXSlfG!W>Q&2}Xj0Fwf4-#n@Mjrt4PnVg z^67ER$h}9O%yBBko@=+jU9Ks#b|lh5VQiDF;~k;Y_+9)$KTXwU(Bg9&>FMxkt)*mH z0`Y;yJ&c4P)QTp&z}*GY4L9&{6%Zu;L1aB2^guH5eA*Bg#%TB1zO^%iT|G)|eBhcK z?8=%BBOW$pSSq$F8Xb8?*&aJ8x*89WQRlSi8ldme|C`aYau!DXu0K+xK2g0<7U|>* z9X=@#wx04eX?8pW2}S*6*Jnq0Y#eB+eFT^|>pc~-RRaP!fP+k!B2Sa8#z)>;jBQp9 z?QU`E-fx2fbE2XZDTV7F`}87%u!?~w3*X}g6}nVuaOv8*8ua`3#!q*vlaY%R?pcYn zLFi9}Is&$fbjJx4WZLyQfm|IGUr(}~9-6vi`8esVga;{%j9bG`lt~z4*vZLGI}MB| z3^+aqe1IfL9ehgUV0~-a!x((&7+??1xQNnDXSHp20<>82cFp_>m##t&u6c39RSY&y zx{@BFA4US3$ISeD`4?S;>&f%esgLUjzOZ@DTFQp*beXLtMX0q)LF-Sp<@22IB!%5np6L;&xu zi&0>90-Te9e}P*ixElkgQ(hMN0YDt2wikD{%7s~rqW#gpQ1_S_f`g4n-(j(Uq-Zx5 zz;vqZvd(0EeQAL;1Y3GZ=)Wy+5JfN4#?ix)AeN0D)N>p+u6Je`OmHsp98b4VTD15a zeX85*MN!_IsxF*tQK%vafQZtfH=f}3F^Wm@olF-+iBHA=WS~Lr;TW%o6DvnA4z5C< zWLYcp+kK@vmR!sGyvdtbBTyNhnuTG;1@)){7biYqh%f>FhPpuO<4Rce1t%XH8rKgfS*iO&pAFA=EBdg`X} zdLP>gNdFCSRB9%tRBLmO%5jG1bB{JrvW45MWzSI*&AJ5J-Hj*XHx_ww`McZO2{V+3 zY!k1mtC;fE&l&5#Tq4kxGAivic>Pp;2|2ObY$|_`e3a~K+&TDu5FncP$6aVTR)6hd zI3WovwdzYHO>TM{JLpgI99>=;H+?6@WshIBVyB)&T_q)|@Hoae| z96uTAgj6BalRJ{8`7$R}#I#Z)&9bMB+h1?`@r1HbjdZQn@;J70a3L#;VHK~Z?8KL( zd-8Fy7!v$+bP6X~EIrLNBl&rg?~T3cM#W4#oKZx_Y-H7jl?L=eku-G*rX>ClJWhK2 zVL9jeGYlN2gHtW8N?Pe~89QNn4(D~-aGN>_Beo8cJ4=~FTUdEAX&A1O3jO4KDgf}&wdNd}b^%>D`YG-G z_w~f&B5B`)2#u9+k@isM+?Wx~PxA}?@>dN+X*#0yY-Wu~!${F2A|}sKp2vSc9lGmk zbv;)UAceW1Brl_J)EEHAQf(zZr$Y&u(n(`YjA*2pZ^X`4k!`Vi@k-v9;S=h*tlAr7 zxfI#%9p_bwqhH?UtGMA*x%ItqT$gzQD%&q0)CBe6x zdbYR8qgaHhF~w@N$V)`#=KHCj#21rk_!8rT-)=cRqr#qi~#jD z$8%oQn>Uk|%C< zCz3D>_m9q>ddA-hhuEILD!lm zwqU1eNPw$c_iM?(dY+v7SL6K11DAOS@a#{uw$krGqC3xeCyK}$L*VFSl@pFzyU8@+ zt~Lv*5K(l}pIzOn4<|Z;-Sgf{%vvO-{$SQmN|gm!Ts&ju zT78Ee?&RVHD&-Sr-0=yI_TUq_7Y^^7%=jD*x8>Qm^!+^9It8StKh|y}_rg^G3_XPj z7C55JX1qr03i_LnM>l^0C&w>NL5N|(vVm`S81?1!0&dND<359xa*+a zuq4iB{>D?fk)%?uqAC2lQ@oh(ms3o9flx~xV9?b`CJ<%Zp&-=OK$H;(ovsnH0%P8g^U81D%fAH)2g@dZ1VyOEiunVD&0;veu|6=P}Rg?^cXlrtxt7^#3&DIwqNZRI{4Bp7E;KA9;TR}-mJ37Sv-+#Ilsljhr5GsK^r+Rfd-s@A+Bga84*In; z;IbYXkQhlUi55h?_&X?wusFpB%mNw|h$+kEJ8!3PJxL2{tq}!a!D^8x0W_X0#zrXR zqtD^Hx(ddx3a~+rApV+d(8tft6y0JO#7V9VgSaV2Fo4$RH`d@)5 z#FGiWGCSIrGkwhUKKGCIuS=3gH6%P}i$nx1QMgs)aH@IrCyj8@@xv z3>;7nr%>BYJ*zQI5KL94-{)utrpSp9YYqxZwQf^#NVRaEQ>mYY4tQOI7Dzyw)dEC{ zaD2HZYvzTr$+LxV_(BHskK;3EeiefIlWXdt|9u;119?+3oml9Bwxo4{F>iQ)awH*l zX4DMauK;{N^n^+sjw={BC4nbSf!Bu>_2+(tMndPJ_k-Rr4EUaw#RVLAWut;8ub zqDF;$Zb~DG+C)}ol!&`aHipgcZZwZW)8hK_!)IV665l-`)av{ifiNp(owMn3K#A0yMrnz8tEb$W zQ@PIK<2sd=4HkPC?E@ag`T&o~Si=#bHAnn&opnz`GMu`5{ao-9G1j8DtHQ> zn56mGIBQ+Y1|zP@m*&O_20@yo$!R+#r0fK)V@jE+DVeUM6cC}g)mV^yTI6w&NvrHO z$1RDOt{}kAvgKMW;}=2s)fEd~uIE+Mso&wbR;R;3D=` Date: Wed, 20 Dec 2023 15:58:32 +0000 Subject: [PATCH 15/16] NBI Component: - Corrected inclusion of clients for Descriptor Loader - Corrected test data files --- src/nbi/Dockerfile | 11 +- .../tests/data/test-ietf-network-huawei.json | 1944 ----------- src/nbi/tests/data/test-ietf-network.json | 42 +- src/nbi/tests/data/topology-dummy.json | 2902 +++++++++++++++-- src/nbi/tests/data/topology-real.json | 253 +- 5 files changed, 2882 insertions(+), 2270 deletions(-) delete mode 100644 src/nbi/tests/data/test-ietf-network-huawei.json diff --git a/src/nbi/Dockerfile b/src/nbi/Dockerfile index 12b3c8674..31b826e01 100644 --- a/src/nbi/Dockerfile +++ b/src/nbi/Dockerfile @@ -63,9 +63,14 @@ RUN python3 -m pip install -r requirements.txt # Add component files into working directory WORKDIR /var/teraflow COPY src/nbi/. nbi/ -COPY src/context/. context/ -COPY src/service/. service/ -COPY src/slice/. slice/ +COPY src/context/__init__.py context/__init__.py +COPY src/context/client/. context/client/ +COPY src/device/__init__.py device/__init__.py +COPY src/device/client/. device/client/ +COPY src/service/__init__.py service/__init__.py +COPY src/service/client/. service/client/ +COPY src/slice/__init__.py slice/__init__.py +COPY src/slice/client/. slice/client/ RUN mkdir -p /var/teraflow/tests/tools COPY src/tests/tools/mock_osm/. tests/tools/mock_osm/ diff --git a/src/nbi/tests/data/test-ietf-network-huawei.json b/src/nbi/tests/data/test-ietf-network-huawei.json deleted file mode 100644 index 37bf8e57b..000000000 --- a/src/nbi/tests/data/test-ietf-network-huawei.json +++ /dev/null @@ -1,1944 +0,0 @@ -{ - "ietf-network:networks": { - "network": [ - { - "network-id": "providerId-10-clientId-0-topologyId-1", - "ietf-te-topology:te": { - "name": "Huawei-Network" - }, - "ietf-te-topology:te-topology-identifier": { - "provider-id": 10, - "client-id": 0, - "topology-id": "1" - }, - "network-types": { - "ietf-te-topology:te-topology": { - "ietf-otn-topology:otn-topology": {} - } - }, - "node": [ - { - "node-id": "10.0.10.1", - "ietf-te-topology:te-node-id": "10.0.10.1", - "ietf-network-topology:termination-point": [ - { - "tp-id": "501", - "ietf-te-topology:te-tp-id": 501, - "ietf-te-topology:te": { - "name": "1-1-1-1-1", - "admin-status": "up", - "oper-status": "up", - "ietf-otn-topology:client-svc": { - "client-facing": false - }, - "interface-switching-capability": [ - { - "encoding": "ietf-te-types:lsp-encoding-oduk", - "switching-capability": "ietf-te-types:switching-otn", - "max-lsp-bandwidth": [ - { - "priority": 7, - "te-bandwidth": { - "ietf-otn-topology:otn": { - "odu-type": "ietf-layer1-types:ODU4" - } - } - } - ] - } - ] - } - }, - { - "tp-id": "500", - "ietf-te-topology:te-tp-id": 500, - "ietf-te-topology:te": { - "name": "1-1-1-1-1", - "admin-status": "up", - "oper-status": "up", - "ietf-otn-topology:client-svc": { - "client-facing": false - }, - "interface-switching-capability": [ - { - "encoding": "ietf-te-types:lsp-encoding-oduk", - "switching-capability": "ietf-te-types:switching-otn", - "max-lsp-bandwidth": [ - { - "priority": 7, - "te-bandwidth": { - "ietf-otn-topology:otn": { - "odu-type": "ietf-layer1-types:ODU4" - } - } - } - ] - } - ] - } - } - ], - "ietf-te-topology:te": { - "oper-status": "up", - "te-node-attributes": { - "admin-status": "up", - "name": "OA" - }, - "tunnel-termination-point": [ - { - "tunnel-tp-id": "NTAx", - "admin-status": "up", - "oper-status": "up", - "encoding": "ietf-te-types:lsp-encoding-oduk", - "name": "1-1-1-1-1", - "protection-type": "ietf-te-types:lsp-protection-unprotected", - "switching-capability": "ietf-te-types:switching-otn", - "local-link-connectivities": { - "local-link-connectivity": [ - { - "is-allowed": true, - "link-tp-ref": "501" - } - ] - } - }, - { - "tunnel-tp-id": "NTAw", - "admin-status": "up", - "oper-status": "up", - "encoding": "ietf-te-types:lsp-encoding-oduk", - "name": "1-1-1-1-1", - "protection-type": "ietf-te-types:lsp-protection-unprotected", - "switching-capability": "ietf-te-types:switching-otn", - "local-link-connectivities": { - "local-link-connectivity": [ - { - "is-allowed": true, - "link-tp-ref": "500" - } - ] - } - } - ] - } - }, - { - "node-id": "10.0.20.1", - "ietf-te-topology:te-node-id": "10.0.20.1", - "ietf-network-topology:termination-point": [ - { - "tp-id": "501", - "ietf-te-topology:te-tp-id": 501, - "ietf-te-topology:te": { - "name": "1-1-1-1-1", - "admin-status": "up", - "oper-status": "up", - "ietf-otn-topology:client-svc": { - "client-facing": false - }, - "interface-switching-capability": [ - { - "encoding": "ietf-te-types:lsp-encoding-oduk", - "switching-capability": "ietf-te-types:switching-otn", - "max-lsp-bandwidth": [ - { - "priority": 7, - "te-bandwidth": { - "ietf-otn-topology:otn": { - "odu-type": "ietf-layer1-types:ODU4" - } - } - } - ] - } - ] - } - }, - { - "tp-id": "500", - "ietf-te-topology:te-tp-id": 500, - "ietf-te-topology:te": { - "name": "1-1-1-1-1", - "admin-status": "up", - "oper-status": "up", - "ietf-otn-topology:client-svc": { - "client-facing": false - }, - "interface-switching-capability": [ - { - "encoding": "ietf-te-types:lsp-encoding-oduk", - "switching-capability": "ietf-te-types:switching-otn", - "max-lsp-bandwidth": [ - { - "priority": 7, - "te-bandwidth": { - "ietf-otn-topology:otn": { - "odu-type": "ietf-layer1-types:ODU4" - } - } - } - ] - } - ] - } - } - ], - "ietf-te-topology:te": { - "oper-status": "up", - "te-node-attributes": { - "admin-status": "up", - "name": "P" - }, - "tunnel-termination-point": [ - { - "tunnel-tp-id": "NTAx", - "admin-status": "up", - "oper-status": "up", - "encoding": "ietf-te-types:lsp-encoding-oduk", - "name": "1-1-1-1-1", - "protection-type": "ietf-te-types:lsp-protection-unprotected", - "switching-capability": "ietf-te-types:switching-otn", - "local-link-connectivities": { - "local-link-connectivity": [ - { - "is-allowed": true, - "link-tp-ref": "501" - } - ] - } - }, - { - "tunnel-tp-id": "NTAw", - "admin-status": "up", - "oper-status": "up", - "encoding": "ietf-te-types:lsp-encoding-oduk", - "name": "1-1-1-1-1", - "protection-type": "ietf-te-types:lsp-protection-unprotected", - "switching-capability": "ietf-te-types:switching-otn", - "local-link-connectivities": { - "local-link-connectivity": [ - { - "is-allowed": true, - "link-tp-ref": "500" - } - ] - } - } - ] - } - }, - { - "node-id": "10.0.40.1", - "ietf-te-topology:te-node-id": "10.0.40.1", - "ietf-network-topology:termination-point": [ - { - "tp-id": "500", - "ietf-te-topology:te-tp-id": 500, - "ietf-te-topology:te": { - "name": "1-1-1-1-1", - "admin-status": "up", - "oper-status": "up", - "ietf-otn-topology:client-svc": { - "client-facing": false - }, - "interface-switching-capability": [ - { - "encoding": "ietf-te-types:lsp-encoding-oduk", - "switching-capability": "ietf-te-types:switching-otn", - "max-lsp-bandwidth": [ - { - "priority": 7, - "te-bandwidth": { - "ietf-otn-topology:otn": { - "odu-type": "ietf-layer1-types:ODU4" - } - } - } - ] - } - ] - } - }, - { - "tp-id": "501", - "ietf-te-topology:te-tp-id": 501, - "ietf-te-topology:te": { - "name": "1-1-1-1-1", - "admin-status": "up", - "oper-status": "up", - "ietf-otn-topology:client-svc": { - "client-facing": false - }, - "interface-switching-capability": [ - { - "encoding": "ietf-te-types:lsp-encoding-oduk", - "switching-capability": "ietf-te-types:switching-otn", - "max-lsp-bandwidth": [ - { - "priority": 7, - "te-bandwidth": { - "ietf-otn-topology:otn": { - "odu-type": "ietf-layer1-types:ODU4" - } - } - } - ] - } - ] - } - } - ], - "ietf-te-topology:te": { - "oper-status": "up", - "te-node-attributes": { - "admin-status": "up", - "name": "P" - }, - "tunnel-termination-point": [ - { - "tunnel-tp-id": "NTAw", - "admin-status": "up", - "oper-status": "up", - "encoding": "ietf-te-types:lsp-encoding-oduk", - "name": "1-1-1-1-1", - "protection-type": "ietf-te-types:lsp-protection-unprotected", - "switching-capability": "ietf-te-types:switching-otn", - "local-link-connectivities": { - "local-link-connectivity": [ - { - "is-allowed": true, - "link-tp-ref": "500" - } - ] - } - }, - { - "tunnel-tp-id": "NTAx", - "admin-status": "up", - "oper-status": "up", - "encoding": "ietf-te-types:lsp-encoding-oduk", - "name": "1-1-1-1-1", - "protection-type": "ietf-te-types:lsp-protection-unprotected", - "switching-capability": "ietf-te-types:switching-otn", - "local-link-connectivities": { - "local-link-connectivity": [ - { - "is-allowed": true, - "link-tp-ref": "501" - } - ] - } - } - ] - } - }, - { - "node-id": "10.0.30.1", - "ietf-te-topology:te-node-id": "10.0.30.1", - "ietf-network-topology:termination-point": [ - { - "tp-id": "500", - "ietf-te-topology:te-tp-id": 500, - "ietf-te-topology:te": { - "name": "1-1-1-1-1", - "admin-status": "up", - "oper-status": "up", - "ietf-otn-topology:client-svc": { - "client-facing": false - }, - "interface-switching-capability": [ - { - "encoding": "ietf-te-types:lsp-encoding-oduk", - "switching-capability": "ietf-te-types:switching-otn", - "max-lsp-bandwidth": [ - { - "priority": 7, - "te-bandwidth": { - "ietf-otn-topology:otn": { - "odu-type": "ietf-layer1-types:ODU4" - } - } - } - ] - } - ] - } - }, - { - "tp-id": "501", - "ietf-te-topology:te-tp-id": 501, - "ietf-te-topology:te": { - "name": "1-1-1-1-1", - "admin-status": "up", - "oper-status": "up", - "ietf-otn-topology:client-svc": { - "client-facing": false - }, - "interface-switching-capability": [ - { - "encoding": "ietf-te-types:lsp-encoding-oduk", - "switching-capability": "ietf-te-types:switching-otn", - "max-lsp-bandwidth": [ - { - "priority": 7, - "te-bandwidth": { - "ietf-otn-topology:otn": { - "odu-type": "ietf-layer1-types:ODU4" - } - } - } - ] - } - ] - } - } - ], - "ietf-te-topology:te": { - "oper-status": "up", - "te-node-attributes": { - "admin-status": "up", - "name": "OE" - }, - "tunnel-termination-point": [ - { - "tunnel-tp-id": "NTAw", - "admin-status": "up", - "oper-status": "up", - "encoding": "ietf-te-types:lsp-encoding-oduk", - "name": "1-1-1-1-1", - "protection-type": "ietf-te-types:lsp-protection-unprotected", - "switching-capability": "ietf-te-types:switching-otn", - "local-link-connectivities": { - "local-link-connectivity": [ - { - "is-allowed": true, - "link-tp-ref": "500" - } - ] - } - }, - { - "tunnel-tp-id": "NTAx", - "admin-status": "up", - "oper-status": "up", - "encoding": "ietf-te-types:lsp-encoding-oduk", - "name": "1-1-1-1-1", - "protection-type": "ietf-te-types:lsp-protection-unprotected", - "switching-capability": "ietf-te-types:switching-otn", - "local-link-connectivities": { - "local-link-connectivity": [ - { - "is-allowed": true, - "link-tp-ref": "501" - } - ] - } - } - ] - } - } - ], - "ietf-network-topology:link": [ - { - "link-id": "10.0.10.1-501", - "source": { - "source-node": "10.0.10.1", - "source-tp": "501" - }, - "destination": { - "dest-node": "10.0.20.1", - "dest-tp": "501" - }, - "ietf-te-topology:te": { - "oper-status": "up", - "te-link-attributes": { - "access-type": "point-to-point", - "admin-status": "up", - "name": "10.0.10.1-501", - "te-delay-metric": 1, - "max-link-bandwidth": { - "te-bandwidth": { - "ietf-otn-topology:odulist": [ - { - "odu-type": "ietf-layer1-types:ODU0", - "number": 80 - } - ] - } - }, - "unreserved-bandwidth": [ - { - "priority": 7, - "te-bandwidth": { - "ietf-otn-topology:odulist": [ - { - "number": 80, - "odu-type": "ietf-layer1-types:ODU0" - } - ] - } - } - ] - } - } - }, - { - "link-id": "10.0.10.1-500", - "source": { - "source-node": "10.0.10.1", - "source-tp": "500" - }, - "destination": { - "dest-node": "10.0.40.1", - "dest-tp": "500" - }, - "ietf-te-topology:te": { - "oper-status": "up", - "te-link-attributes": { - "access-type": "point-to-point", - "admin-status": "up", - "name": "10.0.10.1-500", - "te-delay-metric": 1, - "max-link-bandwidth": { - "te-bandwidth": { - "ietf-otn-topology:odulist": [ - { - "odu-type": "ietf-layer1-types:ODU0", - "number": 80 - } - ] - } - }, - "unreserved-bandwidth": [ - { - "priority": 7, - "te-bandwidth": { - "ietf-otn-topology:odulist": [ - { - "number": 80, - "odu-type": "ietf-layer1-types:ODU0" - } - ] - } - } - ] - } - } - }, - { - "link-id": "10.0.20.1-501", - "source": { - "source-node": "10.0.20.1", - "source-tp": "501" - }, - "destination": { - "dest-node": "10.0.10.1", - "dest-tp": "501" - }, - "ietf-te-topology:te": { - "oper-status": "up", - "te-link-attributes": { - "access-type": "point-to-point", - "admin-status": "up", - "name": "10.0.20.1-501", - "te-delay-metric": 1, - "max-link-bandwidth": { - "te-bandwidth": { - "ietf-otn-topology:odulist": [ - { - "odu-type": "ietf-layer1-types:ODU0", - "number": 80 - } - ] - } - }, - "unreserved-bandwidth": [ - { - "priority": 7, - "te-bandwidth": { - "ietf-otn-topology:odulist": [ - { - "number": 80, - "odu-type": "ietf-layer1-types:ODU0" - } - ] - } - } - ] - } - } - }, - { - "link-id": "10.0.20.1-500", - "source": { - "source-node": "10.0.20.1", - "source-tp": "500" - }, - "destination": { - "dest-node": "10.0.30.1", - "dest-tp": "500" - }, - "ietf-te-topology:te": { - "oper-status": "up", - "te-link-attributes": { - "access-type": "point-to-point", - "admin-status": "up", - "name": "10.0.20.1-500", - "te-delay-metric": 1, - "max-link-bandwidth": { - "te-bandwidth": { - "ietf-otn-topology:odulist": [ - { - "odu-type": "ietf-layer1-types:ODU0", - "number": 80 - } - ] - } - }, - "unreserved-bandwidth": [ - { - "priority": 7, - "te-bandwidth": { - "ietf-otn-topology:odulist": [ - { - "number": 80, - "odu-type": "ietf-layer1-types:ODU0" - } - ] - } - } - ] - } - } - }, - { - "link-id": "10.0.40.1-500", - "source": { - "source-node": "10.0.40.1", - "source-tp": "500" - }, - "destination": { - "dest-node": "10.0.10.1", - "dest-tp": "500" - }, - "ietf-te-topology:te": { - "oper-status": "up", - "te-link-attributes": { - "access-type": "point-to-point", - "admin-status": "up", - "name": "10.0.40.1-500", - "te-delay-metric": 1, - "max-link-bandwidth": { - "te-bandwidth": { - "ietf-otn-topology:odulist": [ - { - "odu-type": "ietf-layer1-types:ODU0", - "number": 80 - } - ] - } - }, - "unreserved-bandwidth": [ - { - "priority": 7, - "te-bandwidth": { - "ietf-otn-topology:odulist": [ - { - "number": 80, - "odu-type": "ietf-layer1-types:ODU0" - } - ] - } - } - ] - } - } - }, - { - "link-id": "10.0.40.1-501", - "source": { - "source-node": "10.0.40.1", - "source-tp": "501" - }, - "destination": { - "dest-node": "10.0.30.1", - "dest-tp": "501" - }, - "ietf-te-topology:te": { - "oper-status": "up", - "te-link-attributes": { - "access-type": "point-to-point", - "admin-status": "up", - "name": "10.0.40.1-501", - "te-delay-metric": 1, - "max-link-bandwidth": { - "te-bandwidth": { - "ietf-otn-topology:odulist": [ - { - "odu-type": "ietf-layer1-types:ODU0", - "number": 80 - } - ] - } - }, - "unreserved-bandwidth": [ - { - "priority": 7, - "te-bandwidth": { - "ietf-otn-topology:odulist": [ - { - "number": 80, - "odu-type": "ietf-layer1-types:ODU0" - } - ] - } - } - ] - } - } - }, - { - "link-id": "10.0.30.1-500", - "source": { - "source-node": "10.0.30.1", - "source-tp": "500" - }, - "destination": { - "dest-node": "10.0.20.1", - "dest-tp": "500" - }, - "ietf-te-topology:te": { - "oper-status": "up", - "te-link-attributes": { - "access-type": "point-to-point", - "admin-status": "up", - "name": "10.0.30.1-500", - "te-delay-metric": 1, - "max-link-bandwidth": { - "te-bandwidth": { - "ietf-otn-topology:odulist": [ - { - "odu-type": "ietf-layer1-types:ODU0", - "number": 80 - } - ] - } - }, - "unreserved-bandwidth": [ - { - "priority": 7, - "te-bandwidth": { - "ietf-otn-topology:odulist": [ - { - "number": 80, - "odu-type": "ietf-layer1-types:ODU0" - } - ] - } - } - ] - } - } - }, - { - "link-id": "10.0.30.1-501", - "source": { - "source-node": "10.0.30.1", - "source-tp": "501" - }, - "destination": { - "dest-node": "10.0.40.1", - "dest-tp": "501" - }, - "ietf-te-topology:te": { - "oper-status": "up", - "te-link-attributes": { - "access-type": "point-to-point", - "admin-status": "up", - "name": "10.0.30.1-501", - "te-delay-metric": 1, - "max-link-bandwidth": { - "te-bandwidth": { - "ietf-otn-topology:odulist": [ - { - "odu-type": "ietf-layer1-types:ODU0", - "number": 80 - } - ] - } - }, - "unreserved-bandwidth": [ - { - "priority": 7, - "te-bandwidth": { - "ietf-otn-topology:odulist": [ - { - "number": 80, - "odu-type": "ietf-layer1-types:ODU0" - } - ] - } - } - ] - } - } - } - ] - }, - { - "network-id": "providerId-10-clientId-0-topologyId-2", - "ietf-te-topology:te": { - "name": "Huawei-Network" - }, - "ietf-te-topology:te-topology-identifier": { - "provider-id": 10, - "client-id": 0, - "topology-id": "2" - }, - "network-types": { - "ietf-te-topology:te-topology": { - "ietf-eth-te-topology:eth-tran-topology": {} - } - }, - "node": [ - { - "node-id": "10.0.10.1", - "ietf-te-topology:te-node-id": "10.0.10.1", - "ietf-network-topology:termination-point": [ - { - "tp-id": "200", - "ietf-te-topology:te-tp-id": "128.32.33.254", - "ietf-eth-te-topology:eth-svc": { - "client-facing": true, - "supported-classification": { - "port-classification": true, - "vlan-classification": { - "outer-tag": { - "supported-tag-types": [ - "ietf-eth-tran-types:classify-c-vlan", - "ietf-eth-tran-types:classify-s-vlan" - ], - "vlan-bundling": false, - "vlan-range": "1-4094" - } - } - } - }, - "ietf-te-topology:te": { - "name": "endpoint:111", - "admin-status": "up", - "oper-status": "up", - "interface-switching-capability": [ - { - "encoding": "ietf-te-types:lsp-encoding-ethernet", - "switching-capability": "ietf-te-types:switching-l2sc", - "max-lsp-bandwidth": [ - { - "priority": 7, - "te-bandwidth": { - "ietf-eth-te-topology:eth-bandwidth": 10000000 - } - } - ] - } - ] - } - }, - { - "tp-id": "501", - "ietf-te-topology:te-tp-id": 501, - "ietf-eth-te-topology:eth-svc": { - "client-facing": false, - "supported-classification": { - "port-classification": true, - "vlan-classification": { - "outer-tag": { - "supported-tag-types": [ - "ietf-eth-tran-types:classify-c-vlan", - "ietf-eth-tran-types:classify-s-vlan" - ], - "vlan-bundling": false, - "vlan-range": "1-4094" - } - } - } - }, - "ietf-te-topology:te": { - "name": "endpoint:111", - "admin-status": "up", - "oper-status": "up", - "interface-switching-capability": [ - { - "encoding": "ietf-te-types:lsp-encoding-ethernet", - "switching-capability": "ietf-te-types:switching-l2sc", - "max-lsp-bandwidth": [ - { - "priority": 7, - "te-bandwidth": { - "ietf-eth-te-topology:eth-bandwidth": 10000000 - } - } - ] - } - ] - } - }, - { - "tp-id": "500", - "ietf-te-topology:te-tp-id": 500, - "ietf-eth-te-topology:eth-svc": { - "client-facing": false, - "supported-classification": { - "port-classification": true, - "vlan-classification": { - "outer-tag": { - "supported-tag-types": [ - "ietf-eth-tran-types:classify-c-vlan", - "ietf-eth-tran-types:classify-s-vlan" - ], - "vlan-bundling": false, - "vlan-range": "1-4094" - } - } - } - }, - "ietf-te-topology:te": { - "name": "endpoint:111", - "admin-status": "up", - "oper-status": "up", - "interface-switching-capability": [ - { - "encoding": "ietf-te-types:lsp-encoding-ethernet", - "switching-capability": "ietf-te-types:switching-l2sc", - "max-lsp-bandwidth": [ - { - "priority": 7, - "te-bandwidth": { - "ietf-eth-te-topology:eth-bandwidth": 10000000 - } - } - ] - } - ] - } - } - ], - "ietf-te-topology:te": { - "oper-status": "up", - "te-node-attributes": { - "admin-status": "up", - "name": "OA" - } - } - }, - { - "node-id": "10.0.20.1", - "ietf-te-topology:te-node-id": "10.0.20.1", - "ietf-network-topology:termination-point": [ - { - "tp-id": "501", - "ietf-te-topology:te-tp-id": 501, - "ietf-eth-te-topology:eth-svc": { - "client-facing": false, - "supported-classification": { - "port-classification": true, - "vlan-classification": { - "outer-tag": { - "supported-tag-types": [ - "ietf-eth-tran-types:classify-c-vlan", - "ietf-eth-tran-types:classify-s-vlan" - ], - "vlan-bundling": false, - "vlan-range": "1-4094" - } - } - } - }, - "ietf-te-topology:te": { - "name": "endpoint:111", - "admin-status": "up", - "oper-status": "up", - "interface-switching-capability": [ - { - "encoding": "ietf-te-types:lsp-encoding-ethernet", - "switching-capability": "ietf-te-types:switching-l2sc", - "max-lsp-bandwidth": [ - { - "priority": 7, - "te-bandwidth": { - "ietf-eth-te-topology:eth-bandwidth": 10000000 - } - } - ] - } - ] - } - }, - { - "tp-id": "500", - "ietf-te-topology:te-tp-id": 500, - "ietf-eth-te-topology:eth-svc": { - "client-facing": false, - "supported-classification": { - "port-classification": true, - "vlan-classification": { - "outer-tag": { - "supported-tag-types": [ - "ietf-eth-tran-types:classify-c-vlan", - "ietf-eth-tran-types:classify-s-vlan" - ], - "vlan-bundling": false, - "vlan-range": "1-4094" - } - } - } - }, - "ietf-te-topology:te": { - "name": "endpoint:111", - "admin-status": "up", - "oper-status": "up", - "interface-switching-capability": [ - { - "encoding": "ietf-te-types:lsp-encoding-ethernet", - "switching-capability": "ietf-te-types:switching-l2sc", - "max-lsp-bandwidth": [ - { - "priority": 7, - "te-bandwidth": { - "ietf-eth-te-topology:eth-bandwidth": 10000000 - } - } - ] - } - ] - } - } - ], - "ietf-te-topology:te": { - "oper-status": "up", - "te-node-attributes": { - "admin-status": "up", - "name": "P" - } - } - }, - { - "node-id": "10.0.40.1", - "ietf-te-topology:te-node-id": "10.0.40.1", - "ietf-network-topology:termination-point": [ - { - "tp-id": "501", - "ietf-te-topology:te-tp-id": 501, - "ietf-eth-te-topology:eth-svc": { - "client-facing": false, - "supported-classification": { - "port-classification": true, - "vlan-classification": { - "outer-tag": { - "supported-tag-types": [ - "ietf-eth-tran-types:classify-c-vlan", - "ietf-eth-tran-types:classify-s-vlan" - ], - "vlan-bundling": false, - "vlan-range": "1-4094" - } - } - } - }, - "ietf-te-topology:te": { - "name": "endpoint:111", - "admin-status": "up", - "oper-status": "up", - "interface-switching-capability": [ - { - "encoding": "ietf-te-types:lsp-encoding-ethernet", - "switching-capability": "ietf-te-types:switching-l2sc", - "max-lsp-bandwidth": [ - { - "priority": 7, - "te-bandwidth": { - "ietf-eth-te-topology:eth-bandwidth": 10000000 - } - } - ] - } - ] - } - }, - { - "tp-id": "500", - "ietf-te-topology:te-tp-id": 500, - "ietf-eth-te-topology:eth-svc": { - "client-facing": false, - "supported-classification": { - "port-classification": true, - "vlan-classification": { - "outer-tag": { - "supported-tag-types": [ - "ietf-eth-tran-types:classify-c-vlan", - "ietf-eth-tran-types:classify-s-vlan" - ], - "vlan-bundling": false, - "vlan-range": "1-4094" - } - } - } - }, - "ietf-te-topology:te": { - "name": "endpoint:111", - "admin-status": "up", - "oper-status": "up", - "interface-switching-capability": [ - { - "encoding": "ietf-te-types:lsp-encoding-ethernet", - "switching-capability": "ietf-te-types:switching-l2sc", - "max-lsp-bandwidth": [ - { - "priority": 7, - "te-bandwidth": { - "ietf-eth-te-topology:eth-bandwidth": 10000000 - } - } - ] - } - ] - } - } - ], - "ietf-te-topology:te": { - "oper-status": "up", - "te-node-attributes": { - "admin-status": "up", - "name": "P" - } - } - }, - { - "node-id": "10.0.30.1", - "ietf-te-topology:te-node-id": "10.0.30.1", - "ietf-network-topology:termination-point": [ - { - "tp-id": "200", - "ietf-te-topology:te-tp-id": "172.10.33.254", - "ietf-eth-te-topology:eth-svc": { - "client-facing": true, - "supported-classification": { - "port-classification": true, - "vlan-classification": { - "outer-tag": { - "supported-tag-types": [ - "ietf-eth-tran-types:classify-c-vlan", - "ietf-eth-tran-types:classify-s-vlan" - ], - "vlan-bundling": false, - "vlan-range": "1-4094" - } - } - } - }, - "ietf-te-topology:te": { - "name": "endpoint:111", - "admin-status": "up", - "oper-status": "up", - "interface-switching-capability": [ - { - "encoding": "ietf-te-types:lsp-encoding-ethernet", - "switching-capability": "ietf-te-types:switching-l2sc", - "max-lsp-bandwidth": [ - { - "priority": 7, - "te-bandwidth": { - "ietf-eth-te-topology:eth-bandwidth": 10000000 - } - } - ] - } - ] - } - }, - { - "tp-id": "501", - "ietf-te-topology:te-tp-id": 501, - "ietf-eth-te-topology:eth-svc": { - "client-facing": false, - "supported-classification": { - "port-classification": true, - "vlan-classification": { - "outer-tag": { - "supported-tag-types": [ - "ietf-eth-tran-types:classify-c-vlan", - "ietf-eth-tran-types:classify-s-vlan" - ], - "vlan-bundling": false, - "vlan-range": "1-4094" - } - } - } - }, - "ietf-te-topology:te": { - "name": "endpoint:111", - "admin-status": "up", - "oper-status": "up", - "interface-switching-capability": [ - { - "encoding": "ietf-te-types:lsp-encoding-ethernet", - "switching-capability": "ietf-te-types:switching-l2sc", - "max-lsp-bandwidth": [ - { - "priority": 7, - "te-bandwidth": { - "ietf-eth-te-topology:eth-bandwidth": 10000000 - } - } - ] - } - ] - } - }, - { - "tp-id": "500", - "ietf-te-topology:te-tp-id": 500, - "ietf-eth-te-topology:eth-svc": { - "client-facing": false, - "supported-classification": { - "port-classification": true, - "vlan-classification": { - "outer-tag": { - "supported-tag-types": [ - "ietf-eth-tran-types:classify-c-vlan", - "ietf-eth-tran-types:classify-s-vlan" - ], - "vlan-bundling": false, - "vlan-range": "1-4094" - } - } - } - }, - "ietf-te-topology:te": { - "name": "endpoint:111", - "admin-status": "up", - "oper-status": "up", - "interface-switching-capability": [ - { - "encoding": "ietf-te-types:lsp-encoding-ethernet", - "switching-capability": "ietf-te-types:switching-l2sc", - "max-lsp-bandwidth": [ - { - "priority": 7, - "te-bandwidth": { - "ietf-eth-te-topology:eth-bandwidth": 10000000 - } - } - ] - } - ] - } - } - ], - "ietf-te-topology:te": { - "oper-status": "up", - "te-node-attributes": { - "admin-status": "up", - "name": "OE" - } - } - }, - { - "node-id": "128.32.33.5", - "ietf-te-topology:te-node-id": "128.32.33.5", - "ietf-network-topology:termination-point": [ - { - "tp-id": "500", - "ietf-te-topology:te-tp-id": "128.32.33.2", - "ietf-eth-te-topology:eth-svc": { - "client-facing": false, - "supported-classification": { - "port-classification": true, - "vlan-classification": { - "outer-tag": { - "supported-tag-types": [ - "ietf-eth-tran-types:classify-c-vlan", - "ietf-eth-tran-types:classify-s-vlan" - ], - "vlan-bundling": false, - "vlan-range": "1-4094" - } - } - } - }, - "ietf-te-topology:te": { - "name": "endpoint:111", - "admin-status": "up", - "oper-status": "up", - "interface-switching-capability": [ - { - "encoding": "ietf-te-types:lsp-encoding-ethernet", - "switching-capability": "ietf-te-types:switching-l2sc", - "max-lsp-bandwidth": [ - { - "priority": 7, - "te-bandwidth": { - "ietf-eth-te-topology:eth-bandwidth": 10000000 - } - } - ] - } - ] - } - }, - { - "tp-id": "200", - "ietf-te-topology:te-tp-id": 200, - "ietf-eth-te-topology:eth-svc": { - "client-facing": true, - "supported-classification": { - "port-classification": true, - "vlan-classification": { - "outer-tag": { - "supported-tag-types": [ - "ietf-eth-tran-types:classify-c-vlan", - "ietf-eth-tran-types:classify-s-vlan" - ], - "vlan-bundling": false, - "vlan-range": "1-4096" - } - } - } - } - }, - { - "tp-id": "201", - "ietf-te-topology:te-tp-id": 201, - "ietf-eth-te-topology:eth-svc": { - "client-facing": true, - "supported-classification": { - "port-classification": true, - "vlan-classification": { - "outer-tag": { - "supported-tag-types": [ - "ietf-eth-tran-types:classify-c-vlan", - "ietf-eth-tran-types:classify-s-vlan" - ], - "vlan-bundling": false, - "vlan-range": "1-4096" - } - } - } - } - } - ], - "ietf-te-topology:te": { - "oper-status": "up", - "te-node-attributes": { - "admin-status": "up", - "name": "OLT", - "connectivity-matrices": { - "label-restrctions": { - "label-restrction": [ - { - "label-start": { - "te-label": { - "technology": { - "ietf-eth-te-topology:eth": { - "vlanid": 21 - } - } - } - }, - "label-end": { - "te-label": { - "technology": { - "ietf-eth-te-topology:eth": { - "vlanid": 21 - } - } - } - } - }, - { - "label-start": { - "te-label": { - "technology": { - "ietf-eth-te-topology:eth": { - "vlanid": 31 - } - } - } - }, - "label-end": { - "te-label": { - "technology": { - "ietf-eth-te-topology:eth": { - "vlanid": 31 - } - } - } - } - } - ] - } - } - } - } - }, - { - "node-id": "128.32.10.1", - "ietf-te-topology:te-node-id": "128.32.10.1", - "ietf-network-topology:termination-point": [ - { - "tp-id": "500", - "ietf-te-topology:te-tp-id": 500, - "ietf-eth-te-topology:eth-svc": { - "client-facing": false, - "supported-classification": { - "port-classification": true, - "vlan-classification": { - "outer-tag": { - "supported-tag-types": [ - "ietf-eth-tran-types:classify-c-vlan", - "ietf-eth-tran-types:classify-s-vlan" - ], - "vlan-bundling": false, - "vlan-range": "1-4094" - } - } - } - } - }, - { - "tp-id": "200", - "ietf-te-topology:te-tp-id": 200, - "ietf-eth-te-topology:eth-svc": { - "client-facing": true, - "supported-classification": { - "port-classification": true, - "vlan-classification": { - "outer-tag": { - "supported-tag-types": [ - "ietf-eth-tran-types:classify-c-vlan", - "ietf-eth-tran-types:classify-s-vlan" - ], - "vlan-bundling": false, - "vlan-range": "1-4096" - } - } - } - } - } - ], - "ietf-te-topology:te": { - "oper-status": "up", - "te-node-attributes": { - "admin-status": "up", - "name": "ONT1" - } - } - }, - { - "node-id": "128.32.20.1", - "ietf-te-topology:te-node-id": "128.32.20.1", - "ietf-network-topology:termination-point": [ - { - "tp-id": "500", - "ietf-te-topology:te-tp-id": 500, - "ietf-eth-te-topology:eth-svc": { - "client-facing": false, - "supported-classification": { - "port-classification": true, - "vlan-classification": { - "outer-tag": { - "supported-tag-types": [ - "ietf-eth-tran-types:classify-c-vlan", - "ietf-eth-tran-types:classify-s-vlan" - ], - "vlan-bundling": false, - "vlan-range": "1-4094" - } - } - } - } - }, - { - "tp-id": "200", - "ietf-te-topology:te-tp-id": 200, - "ietf-eth-te-topology:eth-svc": { - "client-facing": true, - "supported-classification": { - "port-classification": true, - "vlan-classification": { - "outer-tag": { - "supported-tag-types": [ - "ietf-eth-tran-types:classify-c-vlan", - "ietf-eth-tran-types:classify-s-vlan" - ], - "vlan-bundling": false, - "vlan-range": "1-4096" - } - } - } - } - } - ], - "ietf-te-topology:te": { - "oper-status": "up", - "te-node-attributes": { - "admin-status": "up", - "name": "ONT2" - } - } - } - ], - "ietf-network-topology:link": [ - { - "link-id": "10.0.10.1-200", - "source": { - "source-node": "10.0.10.1", - "source-tp": "200" - }, - "destination": { - "dest-node": "128.32.33.5", - "dest-tp": "500" - }, - "ietf-te-topology:te": { - "oper-status": "up", - "te-link-attributes": { - "access-type": "point-to-point", - "admin-status": "up", - "name": "10.0.10.1-200", - "max-link-bandwidth": { - "te-bandwidth": { - "ietf-eth-te-topology:eth-bandwidth": 10000000 - } - }, - "unreserved-bandwidth": [ - { - "priority": 7, - "te-bandwidth": { - "ietf-eth-te-topology:eth-bandwidth": 10000000 - } - } - ] - } - } - }, - { - "link-id": "128.32.33.5-500", - "source": { - "source-node": "128.32.33.5", - "source-tp": "500" - }, - "destination": { - "dest-node": "10.0.10.1", - "dest-tp": "200" - }, - "ietf-te-topology:te": { - "oper-status": "up", - "te-link-attributes": { - "access-type": "point-to-point", - "admin-status": "up", - "name": "128.32.33.5-500", - "max-link-bandwidth": { - "te-bandwidth": { - "ietf-eth-te-topology:eth-bandwidth": 10000000 - } - }, - "unreserved-bandwidth": [ - { - "priority": 7, - "te-bandwidth": { - "ietf-eth-te-topology:eth-bandwidth": 10000000 - } - } - ] - } - } - }, - { - "link-id": "10.0.10.1-501", - "source": { - "source-node": "10.0.10.1", - "source-tp": "501" - }, - "destination": { - "dest-node": "10.0.20.1", - "dest-tp": "501" - }, - "ietf-te-topology:te": { - "oper-status": "up", - "te-link-attributes": { - "access-type": "point-to-point", - "admin-status": "up", - "name": "10.0.10.1-501", - "max-link-bandwidth": { - "te-bandwidth": { - "ietf-eth-te-topology:eth-bandwidth": 10000000 - } - }, - "unreserved-bandwidth": [ - { - "priority": 7, - "te-bandwidth": { - "ietf-eth-te-topology:eth-bandwidth": 10000000 - } - } - ] - } - } - }, - { - "link-id": "10.0.10.1-500", - "source": { - "source-node": "10.0.10.1", - "source-tp": "500" - }, - "destination": { - "dest-node": "10.0.40.1", - "dest-tp": "500" - }, - "ietf-te-topology:te": { - "oper-status": "up", - "te-link-attributes": { - "access-type": "point-to-point", - "admin-status": "up", - "name": "10.0.10.1-500", - "max-link-bandwidth": { - "te-bandwidth": { - "ietf-eth-te-topology:eth-bandwidth": 10000000 - } - }, - "unreserved-bandwidth": [ - { - "priority": 7, - "te-bandwidth": { - "ietf-eth-te-topology:eth-bandwidth": 10000000 - } - } - ] - } - } - }, - { - "link-id": "10.0.20.1-501", - "source": { - "source-node": "10.0.20.1", - "source-tp": "501" - }, - "destination": { - "dest-node": "10.0.10.1", - "dest-tp": "501" - }, - "ietf-te-topology:te": { - "oper-status": "up", - "te-link-attributes": { - "access-type": "point-to-point", - "admin-status": "up", - "name": "10.0.20.1-501", - "max-link-bandwidth": { - "te-bandwidth": { - "ietf-eth-te-topology:eth-bandwidth": 10000000 - } - }, - "unreserved-bandwidth": [ - { - "priority": 7, - "te-bandwidth": { - "ietf-eth-te-topology:eth-bandwidth": 10000000 - } - } - ] - } - } - }, - { - "link-id": "10.0.20.1-500", - "source": { - "source-node": "10.0.20.1", - "source-tp": "500" - }, - "destination": { - "dest-node": "10.0.30.1", - "dest-tp": "500" - }, - "ietf-te-topology:te": { - "oper-status": "up", - "te-link-attributes": { - "access-type": "point-to-point", - "admin-status": "up", - "name": "10.0.20.1-500", - "max-link-bandwidth": { - "te-bandwidth": { - "ietf-eth-te-topology:eth-bandwidth": 10000000 - } - }, - "unreserved-bandwidth": [ - { - "priority": 7, - "te-bandwidth": { - "ietf-eth-te-topology:eth-bandwidth": 10000000 - } - } - ] - } - } - }, - { - "link-id": "10.0.40.1-501", - "source": { - "source-node": "10.0.40.1", - "source-tp": "501" - }, - "destination": { - "dest-node": "10.0.30.1", - "dest-tp": "501" - }, - "ietf-te-topology:te": { - "oper-status": "up", - "te-link-attributes": { - "access-type": "point-to-point", - "admin-status": "up", - "name": "10.0.40.1-501", - "max-link-bandwidth": { - "te-bandwidth": { - "ietf-eth-te-topology:eth-bandwidth": 10000000 - } - }, - "unreserved-bandwidth": [ - { - "priority": 7, - "te-bandwidth": { - "ietf-eth-te-topology:eth-bandwidth": 10000000 - } - } - ] - } - } - }, - { - "link-id": "10.0.40.1-500", - "source": { - "source-node": "10.0.40.1", - "source-tp": "500" - }, - "destination": { - "dest-node": "10.0.10.1", - "dest-tp": "500" - }, - "ietf-te-topology:te": { - "oper-status": "up", - "te-link-attributes": { - "access-type": "point-to-point", - "admin-status": "up", - "name": "10.0.40.1-500", - "max-link-bandwidth": { - "te-bandwidth": { - "ietf-eth-te-topology:eth-bandwidth": 10000000 - } - }, - "unreserved-bandwidth": [ - { - "priority": 7, - "te-bandwidth": { - "ietf-eth-te-topology:eth-bandwidth": 10000000 - } - } - ] - } - } - }, - { - "link-id": "10.0.30.1-501", - "source": { - "source-node": "10.0.30.1", - "source-tp": "501" - }, - "destination": { - "dest-node": "10.0.40.1", - "dest-tp": "501" - }, - "ietf-te-topology:te": { - "oper-status": "up", - "te-link-attributes": { - "access-type": "point-to-point", - "admin-status": "up", - "name": "10.0.30.1-501", - "max-link-bandwidth": { - "te-bandwidth": { - "ietf-eth-te-topology:eth-bandwidth": 10000000 - } - }, - "unreserved-bandwidth": [ - { - "priority": 7, - "te-bandwidth": { - "ietf-eth-te-topology:eth-bandwidth": 10000000 - } - } - ] - } - } - }, - { - "link-id": "10.0.30.1-500", - "source": { - "source-node": "10.0.0.1", - "source-tp": "500" - }, - "destination": { - "dest-node": "10.0.20.1", - "dest-tp": "500" - }, - "ietf-te-topology:te": { - "oper-status": "up", - "te-link-attributes": { - "access-type": "point-to-point", - "admin-status": "up", - "name": "10.0.30.1-500", - "max-link-bandwidth": { - "te-bandwidth": { - "ietf-eth-te-topology:eth-bandwidth": 10000000 - } - }, - "unreserved-bandwidth": [ - { - "priority": 7, - "te-bandwidth": { - "ietf-eth-te-topology:eth-bandwidth": 10000000 - } - } - ] - } - } - }, - { - "link-id": "128.32.33.5-200", - "source": { - "source-node": "128.32.33.5", - "source-tp": "200" - }, - "destination": { - "dest-node": "128.32.10.1", - "dest-tp": "500" - }, - "ietf-te-topology:te": { - "oper-status": "up", - "te-link-attributes": { - "access-type": "point-to-point", - "admin-status": "up", - "name": "128.32.33.5-200", - "max-link-bandwidth": { - "te-bandwidth": { - "ietf-eth-te-topology:eth-bandwidth": 10000000 - } - }, - "unreserved-bandwidth": [ - { - "priority": 7, - "te-bandwidth": { - "ietf-eth-te-topology:eth-bandwidth": 10000000 - } - } - ] - } - } - }, - { - "link-id": "128.32.10.1-500", - "source": { - "source-node": "128.32.10.1", - "source-tp": "500" - }, - "destination": { - "dest-node": "128.32.33.5", - "dest-tp": "200" - }, - "ietf-te-topology:te": { - "oper-status": "up", - "te-link-attributes": { - "access-type": "point-to-point", - "admin-status": "up", - "name": "128.32.10.1-500", - "max-link-bandwidth": { - "te-bandwidth": { - "ietf-eth-te-topology:eth-bandwidth": 10000000 - } - }, - "unreserved-bandwidth": [ - { - "priority": 7, - "te-bandwidth": { - "ietf-eth-te-topology:eth-bandwidth": 10000000 - } - } - ] - } - } - }, - { - "link-id": "128.32.33.5-201", - "source": { - "source-node": "128.32.33.5", - "source-tp": "201" - }, - "destination": { - "dest-node": "128.32.20.1", - "dest-tp": "500" - }, - "ietf-te-topology:te": { - "oper-status": "up", - "te-link-attributes": { - "access-type": "point-to-point", - "admin-status": "up", - "name": "128.32.33.5-201", - "max-link-bandwidth": { - "te-bandwidth": { - "ietf-eth-te-topology:eth-bandwidth": 10000000 - } - }, - "unreserved-bandwidth": [ - { - "priority": 7, - "te-bandwidth": { - "ietf-eth-te-topology:eth-bandwidth": 10000000 - } - } - ] - } - } - }, - { - "link-id": "128.32.20.1-500", - "source": { - "source-node": "128.32.20.1", - "source-tp": "500" - }, - "destination": { - "dest-node": "128.32.33.5", - "dest-tp": "201" - }, - "ietf-te-topology:te": { - "oper-status": "up", - "te-link-attributes": { - "access-type": "point-to-point", - "admin-status": "up", - "name": "128.32.20.15-500", - "max-link-bandwidth": { - "te-bandwidth": { - "ietf-eth-te-topology:eth-bandwidth": 10000000 - } - }, - "unreserved-bandwidth": [ - { - "priority": 7, - "te-bandwidth": { - "ietf-eth-te-topology:eth-bandwidth": 10000000 - } - } - ] - } - } - } - ] - } - ] - } -} diff --git a/src/nbi/tests/data/test-ietf-network.json b/src/nbi/tests/data/test-ietf-network.json index 2a09d547b..7643ef53a 100644 --- a/src/nbi/tests/data/test-ietf-network.json +++ b/src/nbi/tests/data/test-ietf-network.json @@ -1332,7 +1332,7 @@ "ietf-eth-tran-types:classify-s-vlan" ], "vlan-bundling": false, - "vlan-range": "1-4096" + "vlan-range": "1-4094" } } } @@ -1352,7 +1352,7 @@ "ietf-eth-tran-types:classify-s-vlan" ], "vlan-bundling": false, - "vlan-range": "1-4096" + "vlan-range": "1-4094" } } } @@ -1365,45 +1365,31 @@ "admin-status": "up", "name": "OLT", "connectivity-matrices": { - "label-restrctions": { - "label-restrction": [ + "label-restrictions": { + "label-restriction": [ { + "index": 0, "label-start": { "te-label": { - "technology": { - "ietf-eth-te-topology:eth": { - "vlanid": 21 - } - } + "ietf-eth-te-topology:vlanid": 21 } }, "label-end": { "te-label": { - "technology": { - "ietf-eth-te-topology:eth": { - "vlanid": 21 - } - } + "ietf-eth-te-topology:vlanid": 21 } } }, { + "index": 1, "label-start": { "te-label": { - "technology": { - "ietf-eth-te-topology:eth": { - "vlanid": 31 - } - } + "ietf-eth-te-topology:vlanid": 31 } }, "label-end": { "te-label": { - "technology": { - "ietf-eth-te-topology:eth": { - "vlanid": 31 - } - } + "ietf-eth-te-topology:vlanid": 31 } } } @@ -1451,7 +1437,7 @@ "ietf-eth-tran-types:classify-s-vlan" ], "vlan-bundling": false, - "vlan-range": "1-4096" + "vlan-range": "1-4094" } } } @@ -1504,7 +1490,7 @@ "ietf-eth-tran-types:classify-s-vlan" ], "vlan-bundling": false, - "vlan-range": "1-4096" + "vlan-range": "1-4094" } } } @@ -1812,7 +1798,7 @@ { "link-id": "10.0.30.1-500", "source": { - "source-node": "10.0.0.1", + "source-node": "10.0.30.1", "source-tp": "500" }, "destination": { @@ -1952,7 +1938,7 @@ "te-link-attributes": { "access-type": "point-to-point", "admin-status": "up", - "name": "128.32.20.15-500", + "name": "128.32.20.1-500", "max-link-bandwidth": { "te-bandwidth": { "ietf-eth-te-topology:eth-bandwidth": 10000000 diff --git a/src/nbi/tests/data/topology-dummy.json b/src/nbi/tests/data/topology-dummy.json index 3ee8bf69a..4735bf446 100644 --- a/src/nbi/tests/data/topology-dummy.json +++ b/src/nbi/tests/data/topology-dummy.json @@ -1,362 +1,2840 @@ { - "dummy_mode": true, - "contexts": [ - {"context_id": {"context_uuid": {"uuid": "admin"}}, "name": "admin"} - ], - - "topologies": [ - { - "topology_id": { - "context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "admin"} - }, - "name": "admin" - }, - { - "topology_id": { - "context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"} - }, - "name": "providerId-10-clientId-0-topologyId-1", - "device_ids": [ - {"device_uuid": {"uuid": "10.0.10.1"}}, - {"device_uuid": {"uuid": "10.0.20.1"}}, - {"device_uuid": {"uuid": "10.0.30.1"}}, - {"device_uuid": {"uuid": "10.0.40.1"}} - ] - }, { - "topology_id": { - "context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-2"} + "context_id": { + "context_uuid": { + "uuid": "admin" + } }, - "name": "providerId-10-clientId-0-topologyId-2", - "device_ids": [ - {"device_uuid": {"uuid": "10.0.10.1"}}, - {"device_uuid": {"uuid": "10.0.20.1"}}, - {"device_uuid": {"uuid": "10.0.30.1"}}, - {"device_uuid": {"uuid": "10.0.40.1"}} + "name": "admin", + "service_ids": [], + "slice_ids": [], + "topology_ids": [ + { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } ] } ], - "devices": [ { + "components": [], + "controller_id": {}, "device_config": { "config_rules": [ - {"action": "CONFIGACTION_SET", "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, - {"action": "CONFIGACTION_SET", "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, - {"action": "CONFIGACTION_SET", "custom": {"resource_key": "_connect/settings", "resource_value": "{\n\"endpoints\": [\n{\n\"context_uuid\": \"admin\",\n\"name\": \"mgmt\",\n\"topology_uuid\": \"admin\",\n\"type\": \"mgmt\",\n\"uuid\": \"mgmt\"\n}\n]\n}"}}, - {"action": "CONFIGACTION_SET", "custom": {"resource_key": "/endpoints/endpoint[mgmt]", "resource_value": "{\"context_uuid\": \"admin\", \"name\": \"mgmt\", \"topology_uuid\": \"admin\", \"type\": \"mgmt\", \"uuid\": \"mgmt\"}"}} + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": 0 + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": { + "endpoints": [ + { + "name": "mgmt", + "type": "mgmt", + "uuid": "mgmt" + }, + { + "name": "200", + "type": "copper", + "uuid": "200" + }, + { + "name": "500", + "type": "optical", + "uuid": "500" + }, + { + "name": "501", + "type": "optical", + "uuid": "501" + } + ] + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[mgmt]", + "resource_value": { + "name": "mgmt", + "type": "mgmt", + "uuid": "mgmt" + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[200]", + "resource_value": { + "name": "200", + "type": "copper", + "uuid": "200" + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[500]", + "resource_value": { + "name": "500", + "type": "optical", + "uuid": "500" + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[501]", + "resource_value": { + "name": "501", + "type": "optical", + "uuid": "501" + } + } + } ] }, - "device_drivers": [0], + "device_drivers": [ + 0 + ], "device_endpoints": [ { "endpoint_id": { - "device_id": {"device_uuid": {"uuid": "nce-t"}}, - "endpoint_uuid": {"uuid": "mgmt"}, - "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "admin"}} + "device_id": { + "device_uuid": { + "uuid": "0392c251-b5d3-526b-8f3b-a3d4137829fa" + } + }, + "endpoint_uuid": { + "uuid": "161ad889-3839-5dfb-a4a9-95a1de8c3ad5" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + "endpoint_location": {}, + "endpoint_type": "optical", + "kpi_sample_types": [], + "name": "500" + }, + { + "endpoint_id": { + "device_id": { + "device_uuid": { + "uuid": "0392c251-b5d3-526b-8f3b-a3d4137829fa" + } + }, + "endpoint_uuid": { + "uuid": "1e35cf03-d55d-5648-9cb6-fca37bfbf23a" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + "endpoint_location": {}, + "endpoint_type": "copper", + "kpi_sample_types": [], + "name": "200" + }, + { + "endpoint_id": { + "device_id": { + "device_uuid": { + "uuid": "0392c251-b5d3-526b-8f3b-a3d4137829fa" + } + }, + "endpoint_uuid": { + "uuid": "859813e0-24c1-518e-ba77-44a4f392e321" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + "endpoint_location": {}, + "endpoint_type": "optical", + "kpi_sample_types": [], + "name": "501" + }, + { + "endpoint_id": { + "device_id": { + "device_uuid": { + "uuid": "0392c251-b5d3-526b-8f3b-a3d4137829fa" + } + }, + "endpoint_uuid": { + "uuid": "b72983bd-57d8-5cf8-8ec7-da9084382d7a" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } }, + "endpoint_location": {}, "endpoint_type": "mgmt", + "kpi_sample_types": [], "name": "mgmt" } ], - "device_id": {"device_uuid": {"uuid": "nce-t"}}, + "device_id": { + "device_uuid": { + "uuid": "0392c251-b5d3-526b-8f3b-a3d4137829fa" + } + }, "device_operational_status": 2, - "device_type": "emu-open-line-system", - "name": "nce-t" + "device_type": "emu-packet-router", + "name": "10.0.30.1" }, { - "controller_id": {"device_uuid": {"uuid": "nce-t"}}, + "components": [], + "controller_id": {}, "device_config": { "config_rules": [ - {"action": "CONFIGACTION_SET", "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, - {"action": "CONFIGACTION_SET", "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, - {"action": "CONFIGACTION_SET", "custom": {"resource_key": "_connect/settings", "resource_value": "{\n\"endpoints\": [\n{\n\"context_uuid\": \"admin\",\n\"name\": \"mgmt\",\n\"topology_uuid\": \"admin\",\n\"type\": \"mgmt\",\n\"uuid\": \"mgmt\"\n},\n{\n\"context_uuid\": \"admin\",\n\"name\": \"200\",\n\"topology_uuid\": \"providerId-10-clientId-0-topologyId-2\",\n\"type\": \"copper\",\n\"uuid\": \"uuid-200\"\n},\n{\n\"context_uuid\": \"admin\",\n\"name\": \"500\",\n\"topology_uuid\": \"providerId-10-clientId-0-topologyId-1\",\n\"type\": \"optical\",\n\"uuid\": \"uuid-500\"\n},\n{\n\"context_uuid\": \"admin\",\n\"name\": \"501\",\n\"topology_uuid\": \"providerId-10-clientId-0-topologyId-1\",\n\"type\": \"optical\",\n\"uuid\": \"uuid-501\"\n}\n]\n}"}}, - {"action": "CONFIGACTION_SET", "custom": {"resource_key": "/endpoints/endpoint[mgmt]", "resource_value": "{\"context_uuid\": \"admin\", \"name\": \"mgmt\", \"topology_uuid\": \"admin\", \"type\": \"mgmt\", \"uuid\": \"mgmt\"}"}}, - {"action": "CONFIGACTION_SET", "custom": {"resource_key": "/endpoints/endpoint[uuid-200]", "resource_value": "{\"context_uuid\": \"admin\", \"name\": \"200\", \"topology_uuid\": \"providerId-10-clientId-0-topologyId-2\", \"type\": \"copper\", \"uuid\": \"uuid-200\"}"}}, - {"action": "CONFIGACTION_SET", "custom": {"resource_key": "/endpoints/endpoint[uuid-500]", "resource_value": "{\"context_uuid\": \"admin\", \"name\": \"500\", \"topology_uuid\": \"providerId-10-clientId-0-topologyId-1\", \"type\": \"optical\", \"uuid\": \"uuid-500\"}"}}, - {"action": "CONFIGACTION_SET", "custom": {"resource_key": "/endpoints/endpoint[uuid-501]", "resource_value": "{\"context_uuid\": \"admin\", \"name\": \"501\", \"topology_uuid\": \"providerId-10-clientId-0-topologyId-1\", \"type\": \"optical\", \"uuid\": \"uuid-501\"}"}} + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": 0 + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": { + "endpoints": [ + { + "name": "200", + "type": "copper", + "uuid": "200" + }, + { + "name": "500", + "type": "copper", + "uuid": "500" + } + ] + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[200]", + "resource_value": { + "name": "200", + "type": "copper", + "uuid": "200" + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[500]", + "resource_value": { + "name": "500", + "type": "copper", + "uuid": "500" + } + } + } ] }, - "device_drivers": [0], + "device_drivers": [ + 0 + ], "device_endpoints": [ { "endpoint_id": { - "device_id": {"device_uuid": {"uuid": "10.0.30.1"}}, - "endpoint_uuid": {"uuid": "uuid-200"}, + "device_id": { + "device_uuid": { + "uuid": "118295c8-318a-52ec-a394-529fc4b70f2f" + } + }, + "endpoint_uuid": { + "uuid": "207ef8a3-18fd-5a63-ac24-4a1cc6af3e92" + }, "topology_id": { - "context_id": {"context_uuid": {"uuid": "admin"}}, - "topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-2"} + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } } }, + "endpoint_location": {}, "endpoint_type": "copper", + "kpi_sample_types": [], "name": "200" }, { "endpoint_id": { - "device_id": {"device_uuid": {"uuid": "10.0.30.1"}}, - "endpoint_uuid": {"uuid": "uuid-500"}, + "device_id": { + "device_uuid": { + "uuid": "118295c8-318a-52ec-a394-529fc4b70f2f" + } + }, + "endpoint_uuid": { + "uuid": "6fad7bc2-4ce5-5794-8bf0-ddd06cde20a6" + }, "topology_id": { - "context_id": {"context_uuid": {"uuid": "admin"}}, - "topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"} + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } } }, - "endpoint_type": "optical", + "endpoint_location": {}, + "endpoint_type": "copper", + "kpi_sample_types": [], "name": "500" - }, + } + ], + "device_id": { + "device_uuid": { + "uuid": "118295c8-318a-52ec-a394-529fc4b70f2f" + } + }, + "device_operational_status": 2, + "device_type": "emu-packet-router", + "name": "128.32.10.1" + }, + { + "components": [], + "controller_id": {}, + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": 0 + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": { + "endpoints": [ + { + "name": "mgmt", + "type": "mgmt", + "uuid": "mgmt" + }, + { + "name": "500", + "type": "optical", + "uuid": "500" + }, + { + "name": "501", + "type": "optical", + "uuid": "501" + } + ] + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[mgmt]", + "resource_value": { + "name": "mgmt", + "type": "mgmt", + "uuid": "mgmt" + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[500]", + "resource_value": { + "name": "500", + "type": "optical", + "uuid": "500" + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[501]", + "resource_value": { + "name": "501", + "type": "optical", + "uuid": "501" + } + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [ { "endpoint_id": { - "device_id": {"device_uuid": {"uuid": "10.0.30.1"}}, - "endpoint_uuid": {"uuid": "mgmt"}, - "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "admin"}} + "device_id": { + "device_uuid": { + "uuid": "4f2234d0-a9b8-5a86-b1dd-9139d86e3925" + } + }, + "endpoint_uuid": { + "uuid": "75e62edc-a0f9-53f9-821b-023045db1551" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } }, - "endpoint_type": "mgmt", - "name": "mgmt" + "endpoint_location": {}, + "endpoint_type": "optical", + "kpi_sample_types": [], + "name": "501" }, { "endpoint_id": { - "device_id": {"device_uuid": {"uuid": "10.0.30.1"}}, - "endpoint_uuid": {"uuid": "uuid-501"}, + "device_id": { + "device_uuid": { + "uuid": "4f2234d0-a9b8-5a86-b1dd-9139d86e3925" + } + }, + "endpoint_uuid": { + "uuid": "b5efeee2-5062-5d8f-ae06-f901fed7a7d7" + }, "topology_id": { - "context_id": {"context_uuid": {"uuid": "admin"}}, - "topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"} + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } } }, + "endpoint_location": {}, "endpoint_type": "optical", - "name": "501" + "kpi_sample_types": [], + "name": "500" + }, + { + "endpoint_id": { + "device_id": { + "device_uuid": { + "uuid": "4f2234d0-a9b8-5a86-b1dd-9139d86e3925" + } + }, + "endpoint_uuid": { + "uuid": "ede34dea-6b51-5787-88d2-553fe548f540" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + "endpoint_location": {}, + "endpoint_type": "mgmt", + "kpi_sample_types": [], + "name": "mgmt" } ], - "device_id": {"device_uuid": {"uuid": "10.0.30.1"}}, + "device_id": { + "device_uuid": { + "uuid": "4f2234d0-a9b8-5a86-b1dd-9139d86e3925" + } + }, "device_operational_status": 2, "device_type": "emu-packet-router", - "name": "10.0.30.1" + "name": "10.0.40.1" }, { - "controller_id": {"device_uuid": {"uuid": "nce-t"}}, + "components": [], + "controller_id": {}, "device_config": { "config_rules": [ - {"action": "CONFIGACTION_SET", "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, - {"action": "CONFIGACTION_SET", "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, - {"action": "CONFIGACTION_SET", "custom": {"resource_key": "_connect/settings", "resource_value": "{\n\"endpoints\": [\n{\n\"context_uuid\": \"admin\",\n\"name\": \"mgmt\",\n\"topology_uuid\": \"admin\",\n\"type\": \"mgmt\",\n\"uuid\": \"mgmt\"\n},\n{\n\"context_uuid\": \"admin\",\n\"name\": \"500\",\n\"topology_uuid\": \"providerId-10-clientId-0-topologyId-1\",\n\"type\": \"optical\",\n\"uuid\": \"uuid-500\"\n},\n{\n\"context_uuid\": \"admin\",\n\"name\": \"501\",\n\"topology_uuid\": \"providerId-10-clientId-0-topologyId-1\",\n\"type\": \"optical\",\n\"uuid\": \"uuid-501\"\n}\n]\n}"}}, - {"action": "CONFIGACTION_SET", "custom": {"resource_key": "/endpoints/endpoint[mgmt]", "resource_value": "{\"context_uuid\": \"admin\", \"name\": \"mgmt\", \"topology_uuid\": \"admin\", \"type\": \"mgmt\", \"uuid\": \"mgmt\"}"}}, - {"action": "CONFIGACTION_SET", "custom": {"resource_key": "/endpoints/endpoint[uuid-500]", "resource_value": "{\"context_uuid\": \"admin\", \"name\": \"500\", \"topology_uuid\": \"providerId-10-clientId-0-topologyId-1\", \"type\": \"optical\", \"uuid\": \"uuid-500\"}"}}, - {"action": "CONFIGACTION_SET", "custom": {"resource_key": "/endpoints/endpoint[uuid-501]", "resource_value": "{\"context_uuid\": \"admin\", \"name\": \"501\", \"topology_uuid\": \"providerId-10-clientId-0-topologyId-1\", \"type\": \"optical\", \"uuid\": \"uuid-501\"}"}} + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": 0 + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": { + "endpoints": [ + { + "name": "200", + "type": "copper", + "uuid": "200" + }, + { + "name": "201", + "type": "copper", + "uuid": "201" + }, + { + "name": "500", + "type": "copper", + "uuid": "500" + } + ] + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[200]", + "resource_value": { + "name": "200", + "type": "copper", + "uuid": "200" + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[201]", + "resource_value": { + "name": "201", + "type": "copper", + "uuid": "201" + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[500]", + "resource_value": { + "name": "500", + "type": "copper", + "uuid": "500" + } + } + } ] }, - "device_drivers": [0], + "device_drivers": [ + 0 + ], "device_endpoints": [ { "endpoint_id": { - "device_id": {"device_uuid": {"uuid": "10.0.40.1"}}, - "endpoint_uuid": {"uuid": "uuid-501"}, + "device_id": { + "device_uuid": { + "uuid": "97d846b3-d0ba-5b4d-b12e-a9365eda205c" + } + }, + "endpoint_uuid": { + "uuid": "387f7f12-3168-5c75-801e-f06c8afdbf88" + }, "topology_id": { - "context_id": {"context_uuid": {"uuid": "admin"}}, - "topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"} + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } } }, - "endpoint_type": "optical", - "name": "501" + "endpoint_location": {}, + "endpoint_type": "copper", + "kpi_sample_types": [], + "name": "201" }, { "endpoint_id": { - "device_id": {"device_uuid": {"uuid": "10.0.40.1"}}, - "endpoint_uuid": {"uuid": "uuid-500"}, + "device_id": { + "device_uuid": { + "uuid": "97d846b3-d0ba-5b4d-b12e-a9365eda205c" + } + }, + "endpoint_uuid": { + "uuid": "9095f6af-6381-54fa-9a0e-b1ef5720d163" + }, "topology_id": { - "context_id": {"context_uuid": {"uuid": "admin"}}, - "topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"} + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } } }, - "endpoint_type": "optical", + "endpoint_location": {}, + "endpoint_type": "copper", + "kpi_sample_types": [], "name": "500" }, { "endpoint_id": { - "device_id": {"device_uuid": {"uuid": "10.0.40.1"}}, - "endpoint_uuid": {"uuid": "mgmt"}, - "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "admin"}} + "device_id": { + "device_uuid": { + "uuid": "97d846b3-d0ba-5b4d-b12e-a9365eda205c" + } + }, + "endpoint_uuid": { + "uuid": "c6435612-3aca-590f-89ba-e606f54df474" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } }, - "endpoint_type": "mgmt", - "name": "mgmt" + "endpoint_location": {}, + "endpoint_type": "copper", + "kpi_sample_types": [], + "name": "200" } ], - "device_id": {"device_uuid": {"uuid": "10.0.40.1"}}, + "device_id": { + "device_uuid": { + "uuid": "97d846b3-d0ba-5b4d-b12e-a9365eda205c" + } + }, "device_operational_status": 2, - "device_type": "emu-optical-roadm", - "name": "10.0.40.1" + "device_type": "emu-optical-transponder", + "name": "128.32.33.5" }, { - "controller_id": {"device_uuid": {"uuid": "nce-t"}}, + "components": [], + "controller_id": {}, "device_config": { "config_rules": [ - {"action": "CONFIGACTION_SET", "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, - {"action": "CONFIGACTION_SET", "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, - {"action": "CONFIGACTION_SET", "custom": {"resource_key": "_connect/settings", "resource_value": "{\n\"endpoints\": [\n{\n\"context_uuid\": \"admin\",\n\"name\": \"mgmt\",\n\"topology_uuid\": \"admin\",\n\"type\": \"mgmt\",\n\"uuid\": \"mgmt\"\n},\n{\n\"context_uuid\": \"admin\",\n\"name\": \"200\",\n\"topology_uuid\": \"providerId-10-clientId-0-topologyId-2\",\n\"type\": \"copper\",\n\"uuid\": \"uuid-200\"\n},\n{\n\"context_uuid\": \"admin\",\n\"name\": \"500\",\n\"topology_uuid\": \"providerId-10-clientId-0-topologyId-1\",\n\"type\": \"optical\",\n\"uuid\": \"uuid-500\"\n},\n{\n\"context_uuid\": \"admin\",\n\"name\": \"501\",\n\"topology_uuid\": \"providerId-10-clientId-0-topologyId-1\",\n\"type\": \"optical\",\n\"uuid\": \"uuid-501\"\n}\n]\n}"}}, - {"action": "CONFIGACTION_SET", "custom": {"resource_key": "/endpoints/endpoint[mgmt]", "resource_value": "{\"context_uuid\": \"admin\", \"name\": \"mgmt\", \"topology_uuid\": \"admin\", \"type\": \"mgmt\", \"uuid\": \"mgmt\"}"}}, - {"action": "CONFIGACTION_SET", "custom": {"resource_key": "/endpoints/endpoint[uuid-200]", "resource_value": "{\"context_uuid\": \"admin\", \"name\": \"200\", \"topology_uuid\": \"providerId-10-clientId-0-topologyId-2\", \"type\": \"copper\", \"uuid\": \"uuid-200\"}"}}, - {"action": "CONFIGACTION_SET", "custom": {"resource_key": "/endpoints/endpoint[uuid-500]", "resource_value": "{\"context_uuid\": \"admin\", \"name\": \"500\", \"topology_uuid\": \"providerId-10-clientId-0-topologyId-1\", \"type\": \"optical\", \"uuid\": \"uuid-500\"}"}}, - {"action": "CONFIGACTION_SET", "custom": {"resource_key": "/endpoints/endpoint[uuid-501]", "resource_value": "{\"context_uuid\": \"admin\", \"name\": \"501\", \"topology_uuid\": \"providerId-10-clientId-0-topologyId-1\", \"type\": \"optical\", \"uuid\": \"uuid-501\"}"}} + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": 0 + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": { + "endpoints": [ + { + "name": "mgmt", + "type": "mgmt", + "uuid": "mgmt" + }, + { + "name": "200", + "type": "copper", + "uuid": "200" + }, + { + "name": "500", + "type": "optical", + "uuid": "500" + }, + { + "name": "501", + "type": "optical", + "uuid": "501" + } + ] + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[mgmt]", + "resource_value": { + "name": "mgmt", + "type": "mgmt", + "uuid": "mgmt" + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[200]", + "resource_value": { + "name": "200", + "type": "copper", + "uuid": "200" + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[500]", + "resource_value": { + "name": "500", + "type": "optical", + "uuid": "500" + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[501]", + "resource_value": { + "name": "501", + "type": "optical", + "uuid": "501" + } + } + } ] }, - "device_drivers": [0], + "device_drivers": [ + 0 + ], "device_endpoints": [ { "endpoint_id": { - "device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, - "endpoint_uuid": {"uuid": "mgmt"}, - "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "admin"}} + "device_id": { + "device_uuid": { + "uuid": "bf749ed2-fcc4-5bfc-9116-4ea18b722069" + } + }, + "endpoint_uuid": { + "uuid": "59e1e30f-ea65-5e04-8a91-760a648a02c6" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } }, + "endpoint_location": {}, "endpoint_type": "mgmt", + "kpi_sample_types": [], "name": "mgmt" }, { "endpoint_id": { - "device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, - "endpoint_uuid": {"uuid": "uuid-501"}, + "device_id": { + "device_uuid": { + "uuid": "bf749ed2-fcc4-5bfc-9116-4ea18b722069" + } + }, + "endpoint_uuid": { + "uuid": "70cbb732-8149-59ee-939b-011828e4292b" + }, "topology_id": { - "context_id": {"context_uuid": {"uuid": "admin"}}, - "topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"} + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } } }, - "endpoint_type": "optical", - "name": "501" + "endpoint_location": {}, + "endpoint_type": "copper", + "kpi_sample_types": [], + "name": "200" }, { "endpoint_id": { - "device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, - "endpoint_uuid": {"uuid": "uuid-200"}, + "device_id": { + "device_uuid": { + "uuid": "bf749ed2-fcc4-5bfc-9116-4ea18b722069" + } + }, + "endpoint_uuid": { + "uuid": "a2579e11-2e86-5e53-a235-3dd6ba92bb9a" + }, "topology_id": { - "context_id": {"context_uuid": {"uuid": "admin"}}, - "topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-2"} + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } } }, - "endpoint_type": "copper", - "name": "200" + "endpoint_location": {}, + "endpoint_type": "optical", + "kpi_sample_types": [], + "name": "500" }, { "endpoint_id": { - "device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, - "endpoint_uuid": {"uuid": "uuid-500"}, + "device_id": { + "device_uuid": { + "uuid": "bf749ed2-fcc4-5bfc-9116-4ea18b722069" + } + }, + "endpoint_uuid": { + "uuid": "ad2e136d-a981-5c9a-8427-07352ac03351" + }, "topology_id": { - "context_id": {"context_uuid": {"uuid": "admin"}}, - "topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"} + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } } }, + "endpoint_location": {}, "endpoint_type": "optical", - "name": "500" + "kpi_sample_types": [], + "name": "501" } ], - "device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, + "device_id": { + "device_uuid": { + "uuid": "bf749ed2-fcc4-5bfc-9116-4ea18b722069" + } + }, "device_operational_status": 2, "device_type": "emu-packet-router", "name": "10.0.10.1" }, { - "controller_id": {"device_uuid": {"uuid": "nce-t"}}, + "components": [], + "controller_id": {}, "device_config": { "config_rules": [ - {"action": "CONFIGACTION_SET", "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, - {"action": "CONFIGACTION_SET", "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, - {"action": "CONFIGACTION_SET", "custom": {"resource_key": "_connect/settings", "resource_value": "{\n\"endpoints\": [\n{\n\"context_uuid\": \"admin\",\n\"name\": \"mgmt\",\n\"topology_uuid\": \"admin\",\n\"type\": \"mgmt\",\n\"uuid\": \"mgmt\"\n},\n{\n\"context_uuid\": \"admin\",\n\"name\": \"500\",\n\"topology_uuid\": \"providerId-10-clientId-0-topologyId-1\",\n\"type\": \"optical\",\n\"uuid\": \"uuid-500\"\n},\n{\n\"context_uuid\": \"admin\",\n\"name\": \"501\",\n\"topology_uuid\": \"providerId-10-clientId-0-topologyId-1\",\n\"type\": \"optical\",\n\"uuid\": \"uuid-501\"\n}\n]\n}"}}, - {"action": "CONFIGACTION_SET", "custom": {"resource_key": "/endpoints/endpoint[mgmt]", "resource_value": "{\"context_uuid\": \"admin\", \"name\": \"mgmt\", \"topology_uuid\": \"admin\", \"type\": \"mgmt\", \"uuid\": \"mgmt\"}"}}, - {"action": "CONFIGACTION_SET", "custom": {"resource_key": "/endpoints/endpoint[uuid-500]", "resource_value": "{\"context_uuid\": \"admin\", \"name\": \"500\", \"topology_uuid\": \"providerId-10-clientId-0-topologyId-1\", \"type\": \"optical\", \"uuid\": \"uuid-500\"}"}}, - {"action": "CONFIGACTION_SET", "custom": {"resource_key": "/endpoints/endpoint[uuid-501]", "resource_value": "{\"context_uuid\": \"admin\", \"name\": \"501\", \"topology_uuid\": \"providerId-10-clientId-0-topologyId-1\", \"type\": \"optical\", \"uuid\": \"uuid-501\"}"}} + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": 0 + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": { + "endpoints": [ + { + "name": "mgmt", + "type": "mgmt", + "uuid": "mgmt" + }, + { + "name": "500", + "type": "optical", + "uuid": "500" + }, + { + "name": "501", + "type": "optical", + "uuid": "501" + } + ] + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[mgmt]", + "resource_value": { + "name": "mgmt", + "type": "mgmt", + "uuid": "mgmt" + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[500]", + "resource_value": { + "name": "500", + "type": "optical", + "uuid": "500" + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[501]", + "resource_value": { + "name": "501", + "type": "optical", + "uuid": "501" + } + } + } ] }, - "device_drivers": [0], + "device_drivers": [ + 0 + ], "device_endpoints": [ { "endpoint_id": { - "device_id": {"device_uuid": {"uuid": "10.0.20.1"}}, - "endpoint_uuid": {"uuid": "uuid-500"}, + "device_id": { + "device_uuid": { + "uuid": "cf9c4a78-f019-5023-aa0f-4fdba909473b" + } + }, + "endpoint_uuid": { + "uuid": "23c04144-5ad3-5419-8b96-cf4eb329ca96" + }, "topology_id": { - "context_id": {"context_uuid": {"uuid": "admin"}}, - "topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"} + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } } }, + "endpoint_location": {}, "endpoint_type": "optical", - "name": "500" + "kpi_sample_types": [], + "name": "501" }, { "endpoint_id": { - "device_id": {"device_uuid": {"uuid": "10.0.20.1"}}, - "endpoint_uuid": {"uuid": "uuid-501"}, + "device_id": { + "device_uuid": { + "uuid": "cf9c4a78-f019-5023-aa0f-4fdba909473b" + } + }, + "endpoint_uuid": { + "uuid": "356378dd-952b-5032-912d-37fc21284b4c" + }, "topology_id": { - "context_id": {"context_uuid": {"uuid": "admin"}}, - "topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"} + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } } }, + "endpoint_location": {}, "endpoint_type": "optical", - "name": "501" + "kpi_sample_types": [], + "name": "500" }, { "endpoint_id": { - "device_id": {"device_uuid": {"uuid": "10.0.20.1"}}, - "endpoint_uuid": {"uuid": "mgmt"}, - "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "admin"}} + "device_id": { + "device_uuid": { + "uuid": "cf9c4a78-f019-5023-aa0f-4fdba909473b" + } + }, + "endpoint_uuid": { + "uuid": "da826790-a4b0-5317-b30b-e1370918a644" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } }, + "endpoint_location": {}, "endpoint_type": "mgmt", + "kpi_sample_types": [], "name": "mgmt" } ], - "device_id": {"device_uuid": {"uuid": "10.0.20.1"}}, + "device_id": { + "device_uuid": { + "uuid": "cf9c4a78-f019-5023-aa0f-4fdba909473b" + } + }, "device_operational_status": 2, - "device_type": "emu-optical-roadm", + "device_type": "emu-packet-router", "name": "10.0.20.1" - } - ], - - "links": [ - {"link_id": {"link_uuid": {"uuid": "nce-t/mgmt==10.0.10.1/mgmt"}}, "name": "nce-t/mgmt==10.0.10.1/mgmt", "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "nce-t" }}, "endpoint_uuid": {"uuid": "mgmt"}}, - {"device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, "endpoint_uuid": {"uuid": "mgmt"}} - ]}, - {"link_id": {"link_uuid": {"uuid": "nce-t/mgmt==10.0.20.1/mgmt"}}, "name": "nce-t/mgmt==10.0.20.1/mgmt", "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "nce-t" }}, "endpoint_uuid": {"uuid": "mgmt"}}, - {"device_id": {"device_uuid": {"uuid": "10.0.20.1"}}, "endpoint_uuid": {"uuid": "mgmt"}} - ]}, - {"link_id": {"link_uuid": {"uuid": "nce-t/mgmt==10.0.30.1/mgmt"}}, "name": "nce-t/mgmt==10.0.30.1/mgmt", "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "nce-t" }}, "endpoint_uuid": {"uuid": "mgmt"}}, - {"device_id": {"device_uuid": {"uuid": "10.0.30.1"}}, "endpoint_uuid": {"uuid": "mgmt"}} - ]}, - {"link_id": {"link_uuid": {"uuid": "nce-t/mgmt==10.0.40.1/mgmt"}}, "name": "nce-t/mgmt==10.0.40.1/mgmt", "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "nce-t" }}, "endpoint_uuid": {"uuid": "mgmt"}}, - {"device_id": {"device_uuid": {"uuid": "10.0.40.1"}}, "endpoint_uuid": {"uuid": "mgmt"}} - ]}, - - {"link_id": {"link_uuid": {"uuid": "10.0.10.1/501==10.0.20.1/501"}}, "name": "10.0.10.1-501", "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, "endpoint_uuid": {"uuid": "uuid-501"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}}, - {"device_id": {"device_uuid": {"uuid": "10.0.20.1"}}, "endpoint_uuid": {"uuid": "uuid-501"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}} - ]}, - {"link_id": {"link_uuid": {"uuid": "10.0.20.1/501==10.0.10.1/501"}}, "name": "10.0.20.1-501", "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "10.0.20.1"}}, "endpoint_uuid": {"uuid": "uuid-501"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}}, - {"device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, "endpoint_uuid": {"uuid": "uuid-501"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}} - ]}, - - {"link_id": {"link_uuid": {"uuid": "10.0.10.1/500==10.0.40.1/500"}}, "name": "10.0.10.1-500", "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, "endpoint_uuid": {"uuid": "uuid-500"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}}, - {"device_id": {"device_uuid": {"uuid": "10.0.40.1"}}, "endpoint_uuid": {"uuid": "uuid-500"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}} - ]}, - {"link_id": {"link_uuid": {"uuid": "10.0.40.1/500==10.0.10.1/500"}}, "name": "10.0.40.1-500", "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "10.0.40.1"}}, "endpoint_uuid": {"uuid": "uuid-500"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}}, - {"device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, "endpoint_uuid": {"uuid": "uuid-500"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}} - ]}, - - {"link_id": {"link_uuid": {"uuid": "10.0.20.1/500==10.0.30.1/500"}}, "name": "10.0.20.1-500", "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "10.0.20.1"}}, "endpoint_uuid": {"uuid": "uuid-500"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}}, - {"device_id": {"device_uuid": {"uuid": "10.0.30.1"}}, "endpoint_uuid": {"uuid": "uuid-500"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}} - ]}, - {"link_id": {"link_uuid": {"uuid": "10.0.30.1/500==10.0.20.1/500"}}, "name": "10.0.30.1-500", "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "10.0.30.1"}}, "endpoint_uuid": {"uuid": "uuid-500"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}}, - {"device_id": {"device_uuid": {"uuid": "10.0.20.1"}}, "endpoint_uuid": {"uuid": "uuid-500"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}} - ]}, - - {"link_id": {"link_uuid": {"uuid": "10.0.40.1/501==10.0.30.1/501"}}, "name": "10.0.40.1-501", "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "10.0.40.1"}}, "endpoint_uuid": {"uuid": "uuid-501"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}}, - {"device_id": {"device_uuid": {"uuid": "10.0.30.1"}}, "endpoint_uuid": {"uuid": "uuid-501"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}} - ]}, - {"link_id": {"link_uuid": {"uuid": "10.0.30.1/501==10.0.40.1/501"}}, "name": "10.0.30.1-501", "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "10.0.30.1"}}, "endpoint_uuid": {"uuid": "uuid-501"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}}, - {"device_id": {"device_uuid": {"uuid": "10.0.40.1"}}, "endpoint_uuid": {"uuid": "uuid-501"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}} - ]} + }, + { + "components": [], + "controller_id": {}, + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": 0 + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": { + "endpoints": [ + { + "name": "eth1", + "type": "copper", + "uuid": "eth1" + } + ] + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[eth1]", + "resource_value": { + "name": "eth1", + "type": "copper", + "uuid": "eth1" + } + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [ + { + "endpoint_id": { + "device_id": { + "device_uuid": { + "uuid": "df4be2f2-a4a2-587d-b3ed-61a53cae3aa6" + } + }, + "endpoint_uuid": { + "uuid": "0701f406-633f-53e7-a44d-c93384745df8" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + "endpoint_location": {}, + "endpoint_type": "copper", + "kpi_sample_types": [], + "name": "eth1" + } + ], + "device_id": { + "device_uuid": { + "uuid": "df4be2f2-a4a2-587d-b3ed-61a53cae3aa6" + } + }, + "device_operational_status": 2, + "device_type": "emu-client", + "name": "128.32.20.5" + }, + { + "components": [], + "controller_id": {}, + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": 0 + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": { + "endpoints": [ + { + "name": "200", + "type": "copper", + "uuid": "200" + }, + { + "name": "500", + "type": "copper", + "uuid": "500" + } + ] + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[200]", + "resource_value": { + "name": "200", + "type": "copper", + "uuid": "200" + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[500]", + "resource_value": { + "name": "500", + "type": "copper", + "uuid": "500" + } + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [ + { + "endpoint_id": { + "device_id": { + "device_uuid": { + "uuid": "e15007fb-aae4-50d6-b686-b6dc4ae504e2" + } + }, + "endpoint_uuid": { + "uuid": "852a3fd3-3f55-5e31-865d-c52984efb186" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + "endpoint_location": {}, + "endpoint_type": "copper", + "kpi_sample_types": [], + "name": "500" + }, + { + "endpoint_id": { + "device_id": { + "device_uuid": { + "uuid": "e15007fb-aae4-50d6-b686-b6dc4ae504e2" + } + }, + "endpoint_uuid": { + "uuid": "bbbec9f8-618a-591a-bc3e-c188ee31008e" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + "endpoint_location": {}, + "endpoint_type": "copper", + "kpi_sample_types": [], + "name": "200" + } + ], + "device_id": { + "device_uuid": { + "uuid": "e15007fb-aae4-50d6-b686-b6dc4ae504e2" + } + }, + "device_operational_status": 2, + "device_type": "emu-packet-router", + "name": "128.32.20.1" + }, + { + "components": [], + "controller_id": {}, + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": 0 + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": { + "endpoints": [ + { + "name": "eth1", + "type": "copper", + "uuid": "eth1" + } + ] + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[eth1]", + "resource_value": { + "name": "eth1", + "type": "copper", + "uuid": "eth1" + } + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [ + { + "endpoint_id": { + "device_id": { + "device_uuid": { + "uuid": "f3840f4a-6ea2-551a-8afd-0f3faa8ac1e6" + } + }, + "endpoint_uuid": { + "uuid": "16d56d61-63cd-5704-9d2a-5515e633b64b" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + "endpoint_location": {}, + "endpoint_type": "copper", + "kpi_sample_types": [], + "name": "eth1" + } + ], + "device_id": { + "device_uuid": { + "uuid": "f3840f4a-6ea2-551a-8afd-0f3faa8ac1e6" + } + }, + "device_operational_status": 2, + "device_type": "emu-client", + "name": "128.32.10.5" + }, + { + "components": [], + "controller_id": {}, + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": 0 + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": { + "endpoints": [ + { + "name": "mgmt", + "type": "mgmt", + "uuid": "mgmt" + } + ] + } + } + }, + { + "action": 1, + "custom": { + "resource_key": "/endpoints/endpoint[mgmt]", + "resource_value": { + "name": "mgmt", + "type": "mgmt", + "uuid": "mgmt" + } + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [ + { + "endpoint_id": { + "device_id": { + "device_uuid": { + "uuid": "fe0dc2e8-b9ce-555f-8f28-a1a4468fabde" + } + }, + "endpoint_uuid": { + "uuid": "086906ec-fd3b-55e1-b9bb-5a9e5bb5daff" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + "endpoint_location": {}, + "endpoint_type": "mgmt", + "kpi_sample_types": [], + "name": "mgmt" + } + ], + "device_id": { + "device_uuid": { + "uuid": "fe0dc2e8-b9ce-555f-8f28-a1a4468fabde" + } + }, + "device_operational_status": 2, + "device_type": "emu-open-line-system", + "name": "nce-t" + } + ], + "dummy_mode": true, + "links": [ + { + "attributes": { + "total_capacity_gbps": 10.0, + "used_capacity_gbps": 0.0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "bf749ed2-fcc4-5bfc-9116-4ea18b722069" + } + }, + "endpoint_uuid": { + "uuid": "70cbb732-8149-59ee-939b-011828e4292b" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "97d846b3-d0ba-5b4d-b12e-a9365eda205c" + } + }, + "endpoint_uuid": { + "uuid": "9095f6af-6381-54fa-9a0e-b1ef5720d163" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "0b3d5943-c2bf-595f-a805-dc29c2be2f52" + } + }, + "name": "10.0.10.1-200" + }, + { + "attributes": { + "total_capacity_gbps": 10.0, + "used_capacity_gbps": 0.0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "4f2234d0-a9b8-5a86-b1dd-9139d86e3925" + } + }, + "endpoint_uuid": { + "uuid": "b5efeee2-5062-5d8f-ae06-f901fed7a7d7" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "bf749ed2-fcc4-5bfc-9116-4ea18b722069" + } + }, + "endpoint_uuid": { + "uuid": "a2579e11-2e86-5e53-a235-3dd6ba92bb9a" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "1490e70f-472c-5e4c-8280-21c48ed03477" + } + }, + "name": "10.0.40.1-500" + }, + { + "attributes": { + "total_capacity_gbps": 10.0, + "used_capacity_gbps": 0.0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "118295c8-318a-52ec-a394-529fc4b70f2f" + } + }, + "endpoint_uuid": { + "uuid": "6fad7bc2-4ce5-5794-8bf0-ddd06cde20a6" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "97d846b3-d0ba-5b4d-b12e-a9365eda205c" + } + }, + "endpoint_uuid": { + "uuid": "c6435612-3aca-590f-89ba-e606f54df474" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "18ba8eb2-342b-5a73-aeae-7288ea9bb28b" + } + }, + "name": "128.32.10.1-500" + }, + { + "attributes": { + "total_capacity_gbps": 10.0, + "used_capacity_gbps": 0.0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "118295c8-318a-52ec-a394-529fc4b70f2f" + } + }, + "endpoint_uuid": { + "uuid": "207ef8a3-18fd-5a63-ac24-4a1cc6af3e92" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "f3840f4a-6ea2-551a-8afd-0f3faa8ac1e6" + } + }, + "endpoint_uuid": { + "uuid": "16d56d61-63cd-5704-9d2a-5515e633b64b" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "1901b0dc-1b5e-5fdf-b9ac-9168787464c1" + } + }, + "name": "128.32.10.1-200" + }, + { + "attributes": { + "total_capacity_gbps": 10.0, + "used_capacity_gbps": 0.0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "97d846b3-d0ba-5b4d-b12e-a9365eda205c" + } + }, + "endpoint_uuid": { + "uuid": "9095f6af-6381-54fa-9a0e-b1ef5720d163" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "bf749ed2-fcc4-5bfc-9116-4ea18b722069" + } + }, + "endpoint_uuid": { + "uuid": "70cbb732-8149-59ee-939b-011828e4292b" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "1afdae8b-a281-53aa-99c2-205afb8f4ee7" + } + }, + "name": "128.32.33.5-500" + }, + { + "attributes": { + "total_capacity_gbps": 10.0, + "used_capacity_gbps": 0.0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "cf9c4a78-f019-5023-aa0f-4fdba909473b" + } + }, + "endpoint_uuid": { + "uuid": "356378dd-952b-5032-912d-37fc21284b4c" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "0392c251-b5d3-526b-8f3b-a3d4137829fa" + } + }, + "endpoint_uuid": { + "uuid": "161ad889-3839-5dfb-a4a9-95a1de8c3ad5" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "30ca0f8f-b150-57f2-ae5e-8a6844944783" + } + }, + "name": "10.0.20.1-500" + }, + { + "attributes": { + "total_capacity_gbps": 10.0, + "used_capacity_gbps": 0.0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "cf9c4a78-f019-5023-aa0f-4fdba909473b" + } + }, + "endpoint_uuid": { + "uuid": "23c04144-5ad3-5419-8b96-cf4eb329ca96" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "bf749ed2-fcc4-5bfc-9116-4ea18b722069" + } + }, + "endpoint_uuid": { + "uuid": "ad2e136d-a981-5c9a-8427-07352ac03351" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "34c9c6c3-0dcf-54e5-ba67-da33eb2d3c1a" + } + }, + "name": "10.0.20.1-501" + }, + { + "attributes": { + "total_capacity_gbps": 10.0, + "used_capacity_gbps": 0.0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "0392c251-b5d3-526b-8f3b-a3d4137829fa" + } + }, + "endpoint_uuid": { + "uuid": "161ad889-3839-5dfb-a4a9-95a1de8c3ad5" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "cf9c4a78-f019-5023-aa0f-4fdba909473b" + } + }, + "endpoint_uuid": { + "uuid": "356378dd-952b-5032-912d-37fc21284b4c" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "35801e61-45f3-564e-ad5c-09baf4aae906" + } + }, + "name": "10.0.30.1-500" + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "fe0dc2e8-b9ce-555f-8f28-a1a4468fabde" + } + }, + "endpoint_uuid": { + "uuid": "086906ec-fd3b-55e1-b9bb-5a9e5bb5daff" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "4f2234d0-a9b8-5a86-b1dd-9139d86e3925" + } + }, + "endpoint_uuid": { + "uuid": "ede34dea-6b51-5787-88d2-553fe548f540" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "36856920-3387-5384-b1b1-dbc9e54da226" + } + }, + "name": "nce-t/mgmt==10.0.40.1/mgmt" + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "fe0dc2e8-b9ce-555f-8f28-a1a4468fabde" + } + }, + "endpoint_uuid": { + "uuid": "086906ec-fd3b-55e1-b9bb-5a9e5bb5daff" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "0392c251-b5d3-526b-8f3b-a3d4137829fa" + } + }, + "endpoint_uuid": { + "uuid": "b72983bd-57d8-5cf8-8ec7-da9084382d7a" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "46ba12f9-dd17-5f2a-9558-e4611515a6b9" + } + }, + "name": "nce-t/mgmt==10.0.30.1/mgmt" + }, + { + "attributes": { + "total_capacity_gbps": 10.0, + "used_capacity_gbps": 0.0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "0392c251-b5d3-526b-8f3b-a3d4137829fa" + } + }, + "endpoint_uuid": { + "uuid": "859813e0-24c1-518e-ba77-44a4f392e321" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "4f2234d0-a9b8-5a86-b1dd-9139d86e3925" + } + }, + "endpoint_uuid": { + "uuid": "75e62edc-a0f9-53f9-821b-023045db1551" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "4dfe28dd-ac28-53d5-b330-1707e350d772" + } + }, + "name": "10.0.30.1-501" + }, + { + "attributes": { + "total_capacity_gbps": 10.0, + "used_capacity_gbps": 0.0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "e15007fb-aae4-50d6-b686-b6dc4ae504e2" + } + }, + "endpoint_uuid": { + "uuid": "852a3fd3-3f55-5e31-865d-c52984efb186" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "97d846b3-d0ba-5b4d-b12e-a9365eda205c" + } + }, + "endpoint_uuid": { + "uuid": "387f7f12-3168-5c75-801e-f06c8afdbf88" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "644ab377-572c-53a4-8ab5-f5cf45591d88" + } + }, + "name": "128.32.20.1-500" + }, + { + "attributes": { + "total_capacity_gbps": 10.0, + "used_capacity_gbps": 0.0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "97d846b3-d0ba-5b4d-b12e-a9365eda205c" + } + }, + "endpoint_uuid": { + "uuid": "c6435612-3aca-590f-89ba-e606f54df474" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "118295c8-318a-52ec-a394-529fc4b70f2f" + } + }, + "endpoint_uuid": { + "uuid": "6fad7bc2-4ce5-5794-8bf0-ddd06cde20a6" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "661ac531-4309-58cc-b70e-2a79492c2488" + } + }, + "name": "128.32.33.5-200" + }, + { + "attributes": { + "total_capacity_gbps": 10.0, + "used_capacity_gbps": 0.0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "97d846b3-d0ba-5b4d-b12e-a9365eda205c" + } + }, + "endpoint_uuid": { + "uuid": "387f7f12-3168-5c75-801e-f06c8afdbf88" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "e15007fb-aae4-50d6-b686-b6dc4ae504e2" + } + }, + "endpoint_uuid": { + "uuid": "852a3fd3-3f55-5e31-865d-c52984efb186" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "6a236e01-853c-51d0-8915-2d09b45923b0" + } + }, + "name": "128.32.33.5-201" + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "fe0dc2e8-b9ce-555f-8f28-a1a4468fabde" + } + }, + "endpoint_uuid": { + "uuid": "086906ec-fd3b-55e1-b9bb-5a9e5bb5daff" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "cf9c4a78-f019-5023-aa0f-4fdba909473b" + } + }, + "endpoint_uuid": { + "uuid": "da826790-a4b0-5317-b30b-e1370918a644" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "6c802ae7-59d1-55e7-9498-146c465bcab5" + } + }, + "name": "nce-t/mgmt==10.0.20.1/mgmt" + }, + { + "attributes": { + "total_capacity_gbps": 10.0, + "used_capacity_gbps": 0.0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "e15007fb-aae4-50d6-b686-b6dc4ae504e2" + } + }, + "endpoint_uuid": { + "uuid": "bbbec9f8-618a-591a-bc3e-c188ee31008e" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "df4be2f2-a4a2-587d-b3ed-61a53cae3aa6" + } + }, + "endpoint_uuid": { + "uuid": "0701f406-633f-53e7-a44d-c93384745df8" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "6fa77ad9-e4d7-5830-bf84-ab206eff613a" + } + }, + "name": "128.32.20.1-200" + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "fe0dc2e8-b9ce-555f-8f28-a1a4468fabde" + } + }, + "endpoint_uuid": { + "uuid": "086906ec-fd3b-55e1-b9bb-5a9e5bb5daff" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "bf749ed2-fcc4-5bfc-9116-4ea18b722069" + } + }, + "endpoint_uuid": { + "uuid": "59e1e30f-ea65-5e04-8a91-760a648a02c6" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "85a18715-3ce0-57f9-8025-5634fe622a06" + } + }, + "name": "nce-t/mgmt==10.0.10.1/mgmt" + }, + { + "attributes": { + "total_capacity_gbps": 10.0, + "used_capacity_gbps": 0.0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "4f2234d0-a9b8-5a86-b1dd-9139d86e3925" + } + }, + "endpoint_uuid": { + "uuid": "75e62edc-a0f9-53f9-821b-023045db1551" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "0392c251-b5d3-526b-8f3b-a3d4137829fa" + } + }, + "endpoint_uuid": { + "uuid": "859813e0-24c1-518e-ba77-44a4f392e321" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "8e8d1a2b-beae-5624-8826-9235bd73a3a8" + } + }, + "name": "10.0.40.1-501" + }, + { + "attributes": { + "total_capacity_gbps": 10.0, + "used_capacity_gbps": 0.0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "bf749ed2-fcc4-5bfc-9116-4ea18b722069" + } + }, + "endpoint_uuid": { + "uuid": "a2579e11-2e86-5e53-a235-3dd6ba92bb9a" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "4f2234d0-a9b8-5a86-b1dd-9139d86e3925" + } + }, + "endpoint_uuid": { + "uuid": "b5efeee2-5062-5d8f-ae06-f901fed7a7d7" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "e9c5b57e-de50-509c-9f5a-0107ff233703" + } + }, + "name": "10.0.10.1-500" + }, + { + "attributes": { + "total_capacity_gbps": 10.0, + "used_capacity_gbps": 0.0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "df4be2f2-a4a2-587d-b3ed-61a53cae3aa6" + } + }, + "endpoint_uuid": { + "uuid": "0701f406-633f-53e7-a44d-c93384745df8" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "e15007fb-aae4-50d6-b686-b6dc4ae504e2" + } + }, + "endpoint_uuid": { + "uuid": "bbbec9f8-618a-591a-bc3e-c188ee31008e" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "effca6e0-acf3-5c02-ba9a-d82c17a3f006" + } + }, + "name": "128.32.20.5-eth1" + }, + { + "attributes": { + "total_capacity_gbps": 10.0, + "used_capacity_gbps": 0.0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "bf749ed2-fcc4-5bfc-9116-4ea18b722069" + } + }, + "endpoint_uuid": { + "uuid": "ad2e136d-a981-5c9a-8427-07352ac03351" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "cf9c4a78-f019-5023-aa0f-4fdba909473b" + } + }, + "endpoint_uuid": { + "uuid": "23c04144-5ad3-5419-8b96-cf4eb329ca96" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "f45b4432-4ae2-5719-b4e8-a5e8baa1ccd2" + } + }, + "name": "10.0.10.1-501" + }, + { + "attributes": { + "total_capacity_gbps": 10.0, + "used_capacity_gbps": 0.0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "f3840f4a-6ea2-551a-8afd-0f3faa8ac1e6" + } + }, + "endpoint_uuid": { + "uuid": "16d56d61-63cd-5704-9d2a-5515e633b64b" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "118295c8-318a-52ec-a394-529fc4b70f2f" + } + }, + "endpoint_uuid": { + "uuid": "207ef8a3-18fd-5a63-ac24-4a1cc6af3e92" + }, + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "fd005f34-39f5-550e-b2c0-c6e6f8c16325" + } + }, + "name": "128.32.10.5-eth1" + } + ], + "topologies": [ + { + "device_ids": [ + { + "device_uuid": { + "uuid": "0392c251-b5d3-526b-8f3b-a3d4137829fa" + } + }, + { + "device_uuid": { + "uuid": "118295c8-318a-52ec-a394-529fc4b70f2f" + } + }, + { + "device_uuid": { + "uuid": "4f2234d0-a9b8-5a86-b1dd-9139d86e3925" + } + }, + { + "device_uuid": { + "uuid": "97d846b3-d0ba-5b4d-b12e-a9365eda205c" + } + }, + { + "device_uuid": { + "uuid": "bf749ed2-fcc4-5bfc-9116-4ea18b722069" + } + }, + { + "device_uuid": { + "uuid": "cf9c4a78-f019-5023-aa0f-4fdba909473b" + } + }, + { + "device_uuid": { + "uuid": "df4be2f2-a4a2-587d-b3ed-61a53cae3aa6" + } + }, + { + "device_uuid": { + "uuid": "e15007fb-aae4-50d6-b686-b6dc4ae504e2" + } + }, + { + "device_uuid": { + "uuid": "f3840f4a-6ea2-551a-8afd-0f3faa8ac1e6" + } + }, + { + "device_uuid": { + "uuid": "fe0dc2e8-b9ce-555f-8f28-a1a4468fabde" + } + } + ], + "link_ids": [ + { + "link_uuid": { + "uuid": "0b3d5943-c2bf-595f-a805-dc29c2be2f52" + } + }, + { + "link_uuid": { + "uuid": "1490e70f-472c-5e4c-8280-21c48ed03477" + } + }, + { + "link_uuid": { + "uuid": "18ba8eb2-342b-5a73-aeae-7288ea9bb28b" + } + }, + { + "link_uuid": { + "uuid": "1901b0dc-1b5e-5fdf-b9ac-9168787464c1" + } + }, + { + "link_uuid": { + "uuid": "1afdae8b-a281-53aa-99c2-205afb8f4ee7" + } + }, + { + "link_uuid": { + "uuid": "30ca0f8f-b150-57f2-ae5e-8a6844944783" + } + }, + { + "link_uuid": { + "uuid": "34c9c6c3-0dcf-54e5-ba67-da33eb2d3c1a" + } + }, + { + "link_uuid": { + "uuid": "35801e61-45f3-564e-ad5c-09baf4aae906" + } + }, + { + "link_uuid": { + "uuid": "36856920-3387-5384-b1b1-dbc9e54da226" + } + }, + { + "link_uuid": { + "uuid": "46ba12f9-dd17-5f2a-9558-e4611515a6b9" + } + }, + { + "link_uuid": { + "uuid": "4dfe28dd-ac28-53d5-b330-1707e350d772" + } + }, + { + "link_uuid": { + "uuid": "644ab377-572c-53a4-8ab5-f5cf45591d88" + } + }, + { + "link_uuid": { + "uuid": "661ac531-4309-58cc-b70e-2a79492c2488" + } + }, + { + "link_uuid": { + "uuid": "6a236e01-853c-51d0-8915-2d09b45923b0" + } + }, + { + "link_uuid": { + "uuid": "6c802ae7-59d1-55e7-9498-146c465bcab5" + } + }, + { + "link_uuid": { + "uuid": "6fa77ad9-e4d7-5830-bf84-ab206eff613a" + } + }, + { + "link_uuid": { + "uuid": "85a18715-3ce0-57f9-8025-5634fe622a06" + } + }, + { + "link_uuid": { + "uuid": "8e8d1a2b-beae-5624-8826-9235bd73a3a8" + } + }, + { + "link_uuid": { + "uuid": "e9c5b57e-de50-509c-9f5a-0107ff233703" + } + }, + { + "link_uuid": { + "uuid": "effca6e0-acf3-5c02-ba9a-d82c17a3f006" + } + }, + { + "link_uuid": { + "uuid": "f45b4432-4ae2-5719-b4e8-a5e8baa1ccd2" + } + }, + { + "link_uuid": { + "uuid": "fd005f34-39f5-550e-b2c0-c6e6f8c16325" + } + } + ], + "name": "admin", + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } ] -} +} \ No newline at end of file diff --git a/src/nbi/tests/data/topology-real.json b/src/nbi/tests/data/topology-real.json index a5a5562fc..72f04a1df 100644 --- a/src/nbi/tests/data/topology-real.json +++ b/src/nbi/tests/data/topology-real.json @@ -1,39 +1,10 @@ { "contexts": [ - {"context_id": {"context_uuid": {"uuid": "admin"}}, "name": "admin"} + {"context_id": {"context_uuid": {"uuid": "admin"}}} ], "topologies": [ - { - "topology_id": { - "context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "admin"} - }, - "name": "admin" - }, - { - "topology_id": { - "context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"} - }, - "name": "providerId-10-clientId-0-topologyId-1", - "device_ids": [ - {"device_uuid": {"uuid": "10.0.10.1"}}, - {"device_uuid": {"uuid": "10.0.20.1"}}, - {"device_uuid": {"uuid": "10.0.30.1"}}, - {"device_uuid": {"uuid": "10.0.40.1"}} - ] - }, - { - "topology_id": { - "context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-2"} - }, - "name": "providerId-10-clientId-0-topologyId-2", - "device_ids": [ - {"device_uuid": {"uuid": "10.0.10.1"}}, - {"device_uuid": {"uuid": "10.0.20.1"}}, - {"device_uuid": {"uuid": "10.0.30.1"}}, - {"device_uuid": {"uuid": "10.0.40.1"}} - ] - } + {"topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "admin"}}} ], "devices": [ @@ -42,55 +13,108 @@ {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ - {"uuid": "mgmt", "name": "mgmt", "context_uuid": "admin", "topology_uuid": "admin", "type": "mgmt"} + {"uuid": "mgmt", "name": "mgmt", "type": "mgmt"} ]}}} ]}}, - {"device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, "name": "OA (PE)", "device_type": "emu-packet-router", + {"device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, "name": "10.0.10.1", "device_type": "emu-packet-router", + "controller_id": {"device_uuid": {"uuid": "nce-t"}}, "device_operational_status": 1, "device_drivers": [0], "device_config": {"config_rules": [ {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ - {"uuid": "mgmt", "name": "mgmt", "context_uuid": "admin", "topology_uuid": "admin", "type": "mgmt" }, - {"uuid": "uuid-200", "name": "200", "context_uuid": "admin", "topology_uuid": "providerId-10-clientId-0-topologyId-2", "type": "copper" }, - {"uuid": "uuid-500", "name": "500", "context_uuid": "admin", "topology_uuid": "providerId-10-clientId-0-topologyId-1", "type": "optical"}, - {"uuid": "uuid-501", "name": "501", "context_uuid": "admin", "topology_uuid": "providerId-10-clientId-0-topologyId-1", "type": "optical"} + {"uuid": "mgmt", "name": "mgmt", "type": "mgmt" }, + {"uuid": "200", "name": "200", "type": "copper" }, + {"uuid": "500", "name": "500", "type": "optical"}, + {"uuid": "501", "name": "501", "type": "optical"} ]}}} ]}}, - {"device_id": {"device_uuid": {"uuid": "10.0.20.1"}}, "name": "P 1", "device_type": "emu-optical-roadm", + {"device_id": {"device_uuid": {"uuid": "10.0.20.1"}}, "name": "10.0.20.1", "device_type": "emu-packet-router", + "controller_id": {"device_uuid": {"uuid": "nce-t"}}, "device_operational_status": 1, "device_drivers": [0], "device_config": {"config_rules": [ {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ - {"uuid": "mgmt", "name": "mgmt", "context_uuid": "admin", "topology_uuid": "admin", "type": "mgmt" }, - {"uuid": "uuid-500", "name": "500", "context_uuid": "admin", "topology_uuid": "providerId-10-clientId-0-topologyId-1", "type": "optical"}, - {"uuid": "uuid-501", "name": "501", "context_uuid": "admin", "topology_uuid": "providerId-10-clientId-0-topologyId-1", "type": "optical"} + {"uuid": "mgmt", "name": "mgmt", "type": "mgmt" }, + {"uuid": "500", "name": "500", "type": "optical"}, + {"uuid": "501", "name": "501", "type": "optical"} ]}}} ]}}, - {"device_id": {"device_uuid": {"uuid": "10.0.30.1"}}, "name": "OE (PE)", "device_type": "emu-packet-router", - "device_operational_status": 1, "device_drivers": [0], "device_config": {"config_rules": [ + {"device_id": {"device_uuid": {"uuid": "10.0.30.1"}}, "name": "10.0.30.1", "device_type": "emu-packet-router", + "controller_id": {"device_uuid": {"uuid": "nce-t"}}, + "device_operational_status": 1, "device_drivers": [0], "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"uuid": "mgmt", "name": "mgmt", "type": "mgmt" }, + {"uuid": "200", "name": "200", "type": "copper" }, + {"uuid": "500", "name": "500", "type": "optical"}, + {"uuid": "501", "name": "501", "type": "optical"} + ]}}} + ]}}, + + {"device_id": {"device_uuid": {"uuid": "10.0.40.1"}}, "name": "10.0.40.1", "device_type": "emu-packet-router", + "controller_id": {"device_uuid": {"uuid": "nce-t"}}, + "device_operational_status": 1, "device_drivers": [0], "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"uuid": "mgmt", "name": "mgmt", "type": "mgmt" }, + {"uuid": "500", "name": "500", "type": "optical"}, + {"uuid": "501", "name": "501", "type": "optical"} + ]}}} + ]}}, + + {"device_id": {"device_uuid": {"uuid": "128.32.10.5"}}, "name": "128.32.10.5", "device_type": "emu-client", + "device_operational_status": 1, "device_drivers": [0], "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"uuid": "eth1", "name": "eth1", "type": "copper"} + ]}}} + ]}}, + + {"device_id": {"device_uuid": {"uuid": "128.32.10.1"}}, "name": "128.32.10.1", "device_type": "emu-packet-router", + "device_operational_status": 1, "device_drivers": [0], "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"uuid": "200", "name": "200", "type": "copper"}, + {"uuid": "500", "name": "500", "type": "copper"} + ]}}} + ]}}, + + {"device_id": {"device_uuid": {"uuid": "128.32.20.5"}}, "name": "128.32.20.5", "device_type": "emu-client", + "device_operational_status": 1, "device_drivers": [0], "device_config": {"config_rules": [ {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ - {"uuid": "mgmt", "name": "mgmt", "context_uuid": "admin", "topology_uuid": "admin", "type": "mgmt" }, - {"uuid": "uuid-200", "name": "200", "context_uuid": "admin", "topology_uuid": "providerId-10-clientId-0-topologyId-2", "type": "copper" }, - {"uuid": "uuid-500", "name": "500", "context_uuid": "admin", "topology_uuid": "providerId-10-clientId-0-topologyId-1", "type": "optical"}, - {"uuid": "uuid-501", "name": "501", "context_uuid": "admin", "topology_uuid": "providerId-10-clientId-0-topologyId-1", "type": "optical"} + {"uuid": "eth1", "name": "eth1", "type": "copper"} ]}}} - ]}}, - - {"device_id": {"device_uuid": {"uuid": "10.0.40.1"}}, "name": "P 2", "device_type": "emu-optical-roadm", - "device_operational_status": 1, "device_drivers": [0], "device_config": {"config_rules": [ - {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, - {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, - {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ - {"uuid": "mgmt", "name": "mgmt", "context_uuid": "admin", "topology_uuid": "admin", "type": "mgmt" }, - {"uuid": "uuid-500", "name": "500", "context_uuid": "admin", "topology_uuid": "providerId-10-clientId-0-topologyId-1", "type": "optical"}, - {"uuid": "uuid-501", "name": "501", "context_uuid": "admin", "topology_uuid": "providerId-10-clientId-0-topologyId-1", "type": "optical"} - ]}}} - ]}} + ]}}, + + {"device_id": {"device_uuid": {"uuid": "128.32.20.1"}}, "name": "128.32.20.1", "device_type": "emu-packet-router", + "device_operational_status": 1, "device_drivers": [0], "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"uuid": "200", "name": "200", "type": "copper"}, + {"uuid": "500", "name": "500", "type": "copper"} + ]}}} + ]}}, + + {"device_id": {"device_uuid": {"uuid": "128.32.33.5"}}, "name": "128.32.33.5", "device_type": "emu-optical-transponder", + "device_operational_status": 1, "device_drivers": [0], "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"uuid": "200", "name": "200", "type": "copper"}, + {"uuid": "201", "name": "201", "type": "copper"}, + {"uuid": "500", "name": "500", "type": "copper"} + ]}}} + ]}} ], "links": [ @@ -111,40 +135,103 @@ {"device_id": {"device_uuid": {"uuid": "10.0.40.1"}}, "endpoint_uuid": {"uuid": "mgmt"}} ]}, - {"link_id": {"link_uuid": {"uuid": "10.0.10.1/501==10.0.20.1/501"}}, "name": "10.0.10.1/501==10.0.20.1/501", "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, "endpoint_uuid": {"uuid": "uuid-501"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}}, - {"device_id": {"device_uuid": {"uuid": "10.0.20.1"}}, "endpoint_uuid": {"uuid": "uuid-501"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}} + {"link_id": {"link_uuid": {"uuid": "10.0.10.1-501"}}, "name": "10.0.10.1-501", + "attributes": {"total_capacity_gbps": 10, "used_capacity_gbps": 0}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, "endpoint_uuid": {"uuid": "501"}}, + {"device_id": {"device_uuid": {"uuid": "10.0.20.1"}}, "endpoint_uuid": {"uuid": "501"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "10.0.20.1-501"}}, "name": "10.0.20.1-501", + "attributes": {"total_capacity_gbps": 10, "used_capacity_gbps": 0}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "10.0.20.1"}}, "endpoint_uuid": {"uuid": "501"}}, + {"device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, "endpoint_uuid": {"uuid": "501"}} + ]}, + + {"link_id": {"link_uuid": {"uuid": "10.0.10.1-500"}}, "name": "10.0.10.1-500", + "attributes": {"total_capacity_gbps": 10, "used_capacity_gbps": 0}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, "endpoint_uuid": {"uuid": "500"}}, + {"device_id": {"device_uuid": {"uuid": "10.0.40.1"}}, "endpoint_uuid": {"uuid": "500"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "10.0.40.1-500"}}, "name": "10.0.40.1-500", + "attributes": {"total_capacity_gbps": 10, "used_capacity_gbps": 0}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "10.0.40.1"}}, "endpoint_uuid": {"uuid": "500"}}, + {"device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, "endpoint_uuid": {"uuid": "500"}} + ]}, + + {"link_id": {"link_uuid": {"uuid": "10.0.20.1-500"}}, "name": "10.0.20.1-500", + "attributes": {"total_capacity_gbps": 10, "used_capacity_gbps": 0}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "10.0.20.1"}}, "endpoint_uuid": {"uuid": "500"}}, + {"device_id": {"device_uuid": {"uuid": "10.0.30.1"}}, "endpoint_uuid": {"uuid": "500"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "10.0.30.1-500"}}, "name": "10.0.30.1-500", + "attributes": {"total_capacity_gbps": 10, "used_capacity_gbps": 0}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "10.0.30.1"}}, "endpoint_uuid": {"uuid": "500"}}, + {"device_id": {"device_uuid": {"uuid": "10.0.20.1"}}, "endpoint_uuid": {"uuid": "500"}} + ]}, + + {"link_id": {"link_uuid": {"uuid": "10.0.40.1-501"}}, "name": "10.0.40.1-501", + "attributes": {"total_capacity_gbps": 10, "used_capacity_gbps": 0}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "10.0.40.1"}}, "endpoint_uuid": {"uuid": "501"}}, + {"device_id": {"device_uuid": {"uuid": "10.0.30.1"}}, "endpoint_uuid": {"uuid": "501"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "10.0.30.1-501"}}, "name": "10.0.30.1-501", + "attributes": {"total_capacity_gbps": 10, "used_capacity_gbps": 0}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "10.0.30.1"}}, "endpoint_uuid": {"uuid": "501"}}, + {"device_id": {"device_uuid": {"uuid": "10.0.40.1"}}, "endpoint_uuid": {"uuid": "501"}} + ]}, + + {"link_id": {"link_uuid": {"uuid": "128.32.10.5-eth1"}}, "name": "128.32.10.5-eth1", + "attributes": {"total_capacity_gbps": 10, "used_capacity_gbps": 0}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "128.32.10.5"}}, "endpoint_uuid": {"uuid": "eth1"}}, + {"device_id": {"device_uuid": {"uuid": "128.32.10.1"}}, "endpoint_uuid": {"uuid": "200" }} + ]}, + {"link_id": {"link_uuid": {"uuid": "128.32.10.1-200"}}, "name": "128.32.10.1-200", + "attributes": {"total_capacity_gbps": 10, "used_capacity_gbps": 0}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "128.32.10.1"}}, "endpoint_uuid": {"uuid": "200" }}, + {"device_id": {"device_uuid": {"uuid": "128.32.10.5"}}, "endpoint_uuid": {"uuid": "eth1"}} + ]}, + + {"link_id": {"link_uuid": {"uuid": "128.32.10.1-500"}}, "name": "128.32.10.1-500", + "attributes": {"total_capacity_gbps": 10, "used_capacity_gbps": 0}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "128.32.10.1"}}, "endpoint_uuid": {"uuid": "500"}}, + {"device_id": {"device_uuid": {"uuid": "128.32.33.5"}}, "endpoint_uuid": {"uuid": "200"}} ]}, - {"link_id": {"link_uuid": {"uuid": "10.0.20.1/501==10.0.10.1/501"}}, "name": "10.0.20.1/501==10.0.10.1/501", "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "10.0.20.1"}}, "endpoint_uuid": {"uuid": "uuid-501"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}}, - {"device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, "endpoint_uuid": {"uuid": "uuid-501"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}} + {"link_id": {"link_uuid": {"uuid": "128.32.33.5-200"}}, "name": "128.32.33.5-200", + "attributes": {"total_capacity_gbps": 10, "used_capacity_gbps": 0}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "128.32.33.5"}}, "endpoint_uuid": {"uuid": "200"}}, + {"device_id": {"device_uuid": {"uuid": "128.32.10.1"}}, "endpoint_uuid": {"uuid": "500"}} ]}, - {"link_id": {"link_uuid": {"uuid": "10.0.10.1/500==10.0.40.1/500"}}, "name": "10.0.10.1/500==10.0.40.1/500", "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, "endpoint_uuid": {"uuid": "uuid-500"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}}, - {"device_id": {"device_uuid": {"uuid": "10.0.40.1"}}, "endpoint_uuid": {"uuid": "uuid-500"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}} + {"link_id": {"link_uuid": {"uuid": "128.32.20.5-eth1"}}, "name": "128.32.20.5-eth1", + "attributes": {"total_capacity_gbps": 10, "used_capacity_gbps": 0}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "128.32.20.5"}}, "endpoint_uuid": {"uuid": "eth1"}}, + {"device_id": {"device_uuid": {"uuid": "128.32.20.1"}}, "endpoint_uuid": {"uuid": "200" }} ]}, - {"link_id": {"link_uuid": {"uuid": "10.0.40.1/500==10.0.10.1/500"}}, "name": "10.0.40.1/500==10.0.10.1/500", "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "10.0.40.1"}}, "endpoint_uuid": {"uuid": "uuid-500"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}}, - {"device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, "endpoint_uuid": {"uuid": "uuid-500"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}} + {"link_id": {"link_uuid": {"uuid": "128.32.20.1-200"}}, "name": "128.32.20.1-200", + "attributes": {"total_capacity_gbps": 10, "used_capacity_gbps": 0}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "128.32.20.1"}}, "endpoint_uuid": {"uuid": "200" }}, + {"device_id": {"device_uuid": {"uuid": "128.32.20.5"}}, "endpoint_uuid": {"uuid": "eth1"}} ]}, - {"link_id": {"link_uuid": {"uuid": "10.0.20.1/500==10.0.30.1/500"}}, "name": "10.0.20.1/500==10.0.30.1/500", "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "10.0.20.1"}}, "endpoint_uuid": {"uuid": "uuid-500"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}}, - {"device_id": {"device_uuid": {"uuid": "10.0.30.1"}}, "endpoint_uuid": {"uuid": "uuid-500"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}} + {"link_id": {"link_uuid": {"uuid": "128.32.20.1-500"}}, "name": "128.32.20.1-500", + "attributes": {"total_capacity_gbps": 10, "used_capacity_gbps": 0}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "128.32.20.1"}}, "endpoint_uuid": {"uuid": "500"}}, + {"device_id": {"device_uuid": {"uuid": "128.32.33.5"}}, "endpoint_uuid": {"uuid": "201"}} ]}, - {"link_id": {"link_uuid": {"uuid": "10.0.30.1/500==10.0.20.1/500"}}, "name": "10.0.30.1/500==10.0.20.1/500", "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "10.0.30.1"}}, "endpoint_uuid": {"uuid": "uuid-500"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}}, - {"device_id": {"device_uuid": {"uuid": "10.0.20.1"}}, "endpoint_uuid": {"uuid": "uuid-500"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}} + {"link_id": {"link_uuid": {"uuid": "128.32.33.5-201"}}, "name": "128.32.33.5-201", + "attributes": {"total_capacity_gbps": 10, "used_capacity_gbps": 0}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "128.32.33.5"}}, "endpoint_uuid": {"uuid": "201"}}, + {"device_id": {"device_uuid": {"uuid": "128.32.20.1"}}, "endpoint_uuid": {"uuid": "500"}} ]}, - {"link_id": {"link_uuid": {"uuid": "10.0.40.1/501==10.0.30.1/501"}}, "name": "10.0.40.1/501==10.0.30.1/501", "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "10.0.40.1"}}, "endpoint_uuid": {"uuid": "uuid-501"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}}, - {"device_id": {"device_uuid": {"uuid": "10.0.30.1"}}, "endpoint_uuid": {"uuid": "uuid-501"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}} + {"link_id": {"link_uuid": {"uuid": "128.32.33.5-500"}}, "name": "128.32.33.5-500", + "attributes": {"total_capacity_gbps": 10, "used_capacity_gbps": 0}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "128.32.33.5"}}, "endpoint_uuid": {"uuid": "500"}}, + {"device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, "endpoint_uuid": {"uuid": "200"}} ]}, - {"link_id": {"link_uuid": {"uuid": "10.0.30.1/501==10.0.40.1/501"}}, "name": "10.0.30.1/501==10.0.40.1/501", "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "10.0.30.1"}}, "endpoint_uuid": {"uuid": "uuid-501"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}}, - {"device_id": {"device_uuid": {"uuid": "10.0.40.1"}}, "endpoint_uuid": {"uuid": "uuid-501"}, "topology_id": {"topology_uuid": {"uuid": "providerId-10-clientId-0-topologyId-1"}, "context_id": {"context_uuid": {"uuid": "admin"}}}} + {"link_id": {"link_uuid": {"uuid": "10.0.10.1-200"}}, "name": "10.0.10.1-200", + "attributes": {"total_capacity_gbps": 10, "used_capacity_gbps": 0}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "10.0.10.1"}}, "endpoint_uuid": {"uuid": "200"}}, + {"device_id": {"device_uuid": {"uuid": "128.32.33.5"}}, "endpoint_uuid": {"uuid": "500"}} ]} ] } -- GitLab From 1655f72b1160c840187c6412fe814b6015a2007b Mon Sep 17 00:00:00 2001 From: gifrerenom Date: Wed, 20 Dec 2023 16:23:47 +0000 Subject: [PATCH 16/16] NBI Component - IETF Network: - Added README.md with disclaimer --- .../rest_server/nbi_plugins/ietf_network/README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/nbi/service/rest_server/nbi_plugins/ietf_network/README.md diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network/README.md b/src/nbi/service/rest_server/nbi_plugins/ietf_network/README.md new file mode 100644 index 000000000..8d808a45b --- /dev/null +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/README.md @@ -0,0 +1,14 @@ +# IETF Network + +This NBI plugin implements a basic skeleton for the IETF Network data model. + +## DISCLAIMER +__USE WITH CARE! This plugin is NOT production ready, it contains many hardcodings based on ongoing tests.__ + +## IETF RFCs/drafts: +- RFC 8795 - YANG Data Model for Traffic Engineering (TE) Topologies (https://datatracker.ietf.org/doc/html/rfc8795) +- RFC 8776 - Common YANG Data Types for Traffic Engineering (https://datatracker.ietf.org/doc/html/rfc8776) +- RFC 8345 - A YANG Data Model for Network Topologies (https://datatracker.ietf.org/doc/html/rfc8345) +- RFC 6991 - Common YANG Data Types (https://datatracker.ietf.org/doc/html/rfc6991) +- RFC draft-ietf-ccamp-eth-client-te-topo-yang-05 - A YANG Data Model for Ethernet TE Topology (https://datatracker.ietf.org/doc/draft-ietf-ccamp-eth-client-te-topo-yang/) +- RFC draft-ietf-ccamp-client-signal-yang-10 - A YANG Data Model for Transport Network Client Signals (https://datatracker.ietf.org/doc/draft-ietf-ccamp-client-signal-yang/) -- GitLab